Skip to content

Instantly share code, notes, and snippets.

@detroitpro
Created May 31, 2014 19:32
Show Gist options
  • Save detroitpro/eadddec2911b03a442ac to your computer and use it in GitHub Desktop.
Save detroitpro/eadddec2911b03a442ac to your computer and use it in GitHub Desktop.
Can I disable master in Xamarin.Forms MasterDetailPage
public static Page GetMainPage()
{
var masterDetailPage = new MasterDetailPage ();
masterDetailPage.Master = new MenuPage (masterDetailPage);
if(User.IsNotAuthenticated){
//HERE IS WHERE I WOULD LIKE TO DISABLE THE MASTER
masterDetailPage.Detail = new NavigationPage (new LoginPage ()) { };
//This does not do anything.
masterDetailPage.Master.IsEnabled = false;
} else {
masterDetailPage.Detail = new NavigationPage (new CreateWantPage ()) { };
}
return masterDetailPage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment