Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable left menu in master detail page in xamarin forms?

I have masterdetail page and there is left menu in it. Its working fine during user is on masterdetail page. But When user move from master detail page to simple content page(that is not part of master detail page), on this content page if he swipe from left to right left menu opens. How I can disable the left menu on this content page? and why left menu is showing on simple content page while it is not part of the master detail page?

like image 797
anand Avatar asked Dec 19 '22 15:12

anand


1 Answers

If you're still looking for a solution, you can do it like so:

IsGestureEnabled = false;

You can continue to use

await Navigation.PushAsync(new PageWhichWontOpenTheMenu());

To use it, simply get the RootPage (the MasterDetailPage) on the OnAppearing method like so:

protected override void OnAppearing(){
        base.OnAppearing();
        (Application.Current.MainPage as RootPage).IsGestureEnabled = false;
}

Tell me if it works for you, cheers!

like image 164
Tiago Alexandre De Noronha Avatar answered Jun 29 '23 03:06

Tiago Alexandre De Noronha