0

I'm using prism and had a MasterDetailPage with some pages that is accessible from that. But, in some of this pages, I can navigate to other pages that is not accessible from the MasterPageDetail Menu, but menu is still accessible with sliding action. I'll post some prints to try explain.

That's is a page that is accessible from MasterPageDetailMenu First page

When the user is accessing this page, he can access the MasterPageDetail Menu. But if the user select an item of the list or click in "Plus" Floating Button, the app navigate to other Page where MasterPageDetail Menu shouldn't be accessible.

Second Page - Menu shouldn't be accessible

But, as you can see on the next image, if the user slide the page from the left to right, the MasterPageDetail Menu is still accessible

Second page with menu accessible

How can I avoid this behaviour? In the App class, my code for navigate to MasterPageDetail is:

await NavigationService.NavigateAsync("Menu/Navigation/TipoItensCardapio")

In this case, menu is my MasterPagelDetail. The code for navigate from TipoItensCardapio page to the second page is:

NavigationService.NavigateAsync("TipoItemCardapioEdit");
  • Shouldn't the menu be always available, no matter whether or not I can reach the current page directly from the menu? For me, that's working as expected. – Haukinger Jul 27 '18 at 13:50
  • @Haukinger in the native development or Xamarin.Android, that's not the behaviour. In native approach, you can navigate to other pages where the menu is not accessible. If you see the second page, the menu icon isn't visible, that suppose that menu shoun't be accessible. – Vinícius da Cruz Maia Jul 27 '18 at 14:18
  • Not my experience. I'm using xamarin android native and in my app the menu is accessible even if I'm in a "sub-page" with the arrow in the top left. And, btw, the google play store app behaves the same way (on android 6 at least) – Haukinger Jul 27 '18 at 14:44
  • @Vinícius da Cruz Maia Have you solve your problem? Could you share it? – Tony Pham Dec 19 '18 at 04:36

1 Answers1

0

If you intend for a specific page to not allow the drawer to be swiped out it sounds like you should probably be pushing it as a Modal instead of a normal Page. For example:

await Navigation.PushModalAsync(new YourPage());

For more info about Xamarin.Forms modals I'd check out the docs

Nick Peppers
  • 3,161
  • 23
  • 27
  • The requested intention was to use Prism with Xamarin.Forms, not a standalone XF's navigation system – Damian Jan 20 '19 at 13:46