1
votes

I'm using a Prism library (version 7.2.0.1422) on my Xamarin Forms app. After user Login I use a NavigationService.NavigateTo($"/{nameof(MainMasterDetailPage)}/{nameof(MasterDetailNavigationPage)}/{nameof(HomePage)}") method to set the my "MainMasterDetailPage" as Main Page of App.

MasterDetailNavigationPage class:

public class MasterDetailNavigationPage : NavigationPage, INavigationPageOptions
{
    public bool ClearNavigationStackOnNavigation => false;
}

When the user click to an menu item, I use NavigationService.NavigateTo("pagename") method to keep a navigation stack. In this case the Back Button is present and using a swipe gesture the menu is presented.

In some cases I want that the swipe gesture to open menu is disabled because in some page there is a Gesture Recognizer to manage a swipe gesture in my custom view (to draw again etc).

How I can do this with Prism library? I cant access directly to property "Is Gesture Enabled" present on Master Detail Page.

1
Question is unclear, try to be more detailed, if possible showing some code with your attemptsGreggz
Thanks for the edit, so you can't do this Xamarin.Forms.Application.MainPage.IsGestureEnabled = false; ?Greggz
When you enter your specific page, in her constructor you can write that line and it will achieve what you 're looking for, if I understood your question rightGreggz

1 Answers

1
votes

Try this, being SomePage the page where you want to appear this kind of behaviour.

class SomePage : ContentPage {

   public SomePage() {
      // Assuming your MasterDetailPage is the root page of the Application
      Xamarin.Forms.Application.MainPage.IsGestureEnabled = false;
   }
}