In the sample code from Xamarin website, the Detail page was added to a NavigationPage
Detail = new NavigationPage(new TestPage());
Does TestPage have to be wrapped by NavigationPage? If I remove NavigationPage and just put new TestPage()
, it will work on me. If I keep NavigationPage in, I have the error which I have posted in here.
If without NavigationPage, the hamburger icon will be gone, even though still able to show the master page.
From official Xamarin documentation:
Public Constructors
NavigationPage()
Initializes a new NavigationPage object.
NavigationPage(Page)
Creates a new NavigationPage element with root as its root element.
So you only need/want/have to pass a page as argument if you want to specify that it's a root element.
Also in case you developing an UWP app with MasterDetailPage you should keep in mind: