Here is the reference about the navigation with masterDetailpage
In your App.cs you would have something similar to this code (apologies if it doesn't compile, I am coding this off the top of my head).
public static NavigationPage NavPage = null;
public App()
{
var _navPage = new NavigationPage(new PageOne());
var _masterPage = new MasterDetailpage();
_masterPage.Detail = NavPage;
_masterPage.Master = (your master / menu page);
MainPage = _masterPage;
}
Then in your code you can reference
await App.NavPage.PushAsync(new PageTwo());
That gets you functional. However you don't want to access the NavigationPage this way. You can use DependencyInjection to create a NavigationService.
Something like
public class NavigationService: INavigationService
{
public NavigationService(NavigationPage navPage)
{
// Keep local copy of navPage
}
public async Task NavigateTo(Page page)
{
await _navPage.PushAsync(page);
}
public async Task GoBack()
{
await _navPage.PopAsync();
}
}
You should use like this Pattern to navigate.
MainPage = new NavigationPage(new YourMasterDetailPage ());
in app.cs – Leo Zhu - MSFT