I am using Xamarin Forms with Prism. How do you navigate from the MasterDetail.Master to a ContentPage that is not part of the MasterDetail (that is, I don't want to just update the detail and continue to be part of the Master/Detail relationship)? The use case is like the Gmail app when you click on Settings from the Hamburger menu. It takes you out of the Master/Detail and you are now in a NavigationPage/ContentPage with a back button to get back to the MasterDetail page.
If you were not using Prism you could go to the Detail page and do a Navigation.PushAsync from there:
var mdp = Application.Current.MainPage as MasterDetailPage;
mdp.IsPresented = false;
await mdp.Detail.Navigation.PushAsync(new ContentPage2());
But I don't see how to do this using Prism navigation.
-Steve
Assuming your
Application.Current.MainPageis aMasterDetailPage. CurrentDetailin theMasterDetailPageisNavigationPage(new ContentPage1()).In your
ContentPage1, you have 2 options to navigate toContentPage2:Option 1: Show
ContentPage2in current navigation stackYou will be pushing
ContentPage2into the same Navigation stack ofContentPage1. Back button in navigation bar will be added automatically.Option 2: Show
ContentPage2modallyYou are presenting the page modally and in a completely new navigation stack. You will need to add Back button in the NavigationBar and handle the click event with your own code.