In my new Xamarin.Forms App I start with Login Page witch is rendered as NavigationPage. After the login I show the user a Flyout Page. If an item from the Flyout is selected this page will be displayed in the Detail section of the Flyout Page as Navigation Page. The selected page has a button and when the user tapps the button I want to navigate to a new Navigation Page witch is not rendered in the Flyout Page.
I have tried to convert the FlyoutPage to a NavigationPage, but this wasn't a good idea.
Do you have any idea to solve this problem? When I navigate to the new NavigationPage the user should not be able to see or to open the Flyout.
Here you can see my XAML:
<FlyoutPage>
<FlyoutPage.Flyout>
<pages:RootPageFlyout x:Name="FlyoutPage" />
</FlyoutPage.Flyout>
<FlyoutPage.Detail>
<NavigationPage>
<x:Arguments>
<pages:MainPage />
</x:Arguments>
</NavigationPage>
</FlyoutPage.Detail>
</FlyoutPage>
And this is the code behind of the XAML
public partial class RootPage : FlyoutPage
{
public RootPage()
{
InitializeComponent();
FlyoutPage.ListView.ItemSelected += ListView_ItemSelected;
}
private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var item = e.SelectedItem as RootPageFlyoutMenuItem;
if (item == null) return;
var page = (Page)Activator.CreateInstance(item.TargetType);
page.Title = item.Title;
Detail = new NavigationPage(page);
IsPresented = false;
FlyoutPage.ListView.SelectedItem = null;
}
}