A FlyoutPage has a Flyout property that should be set to a ContentPage containing the content of the flyout (or a NavigationPage, once this bug has been fixed) and a Detail property for the remaining content.
As usual, create and register the following:
A ContentPage and ViewModel to be presented in the Flyout's Flyout
Any and all ContentPage and ViewModel classes that may be presented for the Flyout.Detail
Assuming the Flyout property is represented using a FlyoutFlyoutPage bound to a FlyoutFlyoutPageVm, we set our MainPage like this:
namespaceSampleFlyoutApp{publicpartialclassApp:Application{publicApp(IPageServiceZero pageService){InitializeComponent(); // Don't forget to call pageService.Init, or navigation will not work properly!pageService.Init(this); MainPage =pageService.GetFlyoutPage<FlyoutFlyoutPageVm>();}}}
Now we need a way to manage the Detail property of the Flyout. This is achieved using
Here's an example that sets the default view when the page is first presented, and has ICommands to swap between two different detail pages. These pages are wrapped in a NavigationPage, so they in turn can push pages onto their own navigation stack
Now just add two Buttons to FlyoutFlyoutPage.xaml and bind them to Test1Command and Test2Command to swap the Detail view on button click
Take a look at the SampleFlyoutApp source code to see an example of a Flyout containing a tree-structure of options, each one tied to a different Detail page