Skip to content

Files

Latest commit

25ed08a · May 18, 2020

History

History

build-2020

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 18, 2020
May 18, 2020
May 18, 2020
May 18, 2020

Surface Duo + Xamarin at Microsoft Build 2020

These code samples were used in the Microsoft Build 2020 session How to bring your Android apps to Surface Duo with Xamarin.

The session begins with the code for this quickstart documentation. It's been copied from the Xamarin samples GitHub to this folder for reference.

In the session, this sample is used to test how the app works on the Surface Duo emulator.

In this step the sample is modified to support Android drag-and-drop. Three files are added/changed:

  • Notes/ItemDragAndDropEffect.cs - Xamarin.Forms effect in common code
  • Notes.Android/ItemDragAndDropEffect.cs - Effect implementation for Android
  • NotesPage.xaml - Effect added to XAML

The DragAndDrop sample can be used as the 'drag target' to test.

In this step the sample is modified to support dual-screen display using the TwoPaneView. These files are added/changed:

  • Notes.Android/MainActivity.cs - DualScreenService.Init(this);
  • Notes/App.xaml.cs - use new MainPage
  • Notes/NoteEntryPage.xaml+cs - convert to ContentView, move nav/lifecycle methods
  • Notes/NotesPage.xaml+cs - convert to ContentView, move nav/lifecycle methods
  • Notes/MainPage.xaml+cs - hosts TwoPaneView and nav/lifecycle methods

Learn more about the TwoPaneView in the docs.

Next steps

Other samples: