Search code examples
xamarinxamarin.formsprismtabbedpage

Xamarin Forms Prism Navigation from TabbedPage behaves as PushModelAsync or the navigation bar disappears


In Tabbed page sample given by Prism, I want to navigate from ViewA (first tab) to ViewD(not the next tab but next navigation page).

I don't understand why this removes the navigation bar on the top:

_navigationService.NavigateAsync(nameof(ViewD));

Like PushModelAsync instead of PushAsync. So that I loose the back button on the navigation tab which is not intended.

Am I missing something here?


Solution

  • The reason for this is that ViewA’s parent is not a NavigationPage, the result is that the Navigation Service assumes you want modal Navigation. You simply need to add useModalNavigation: false, this will make the Navigation Service push ViewD correctly inside the Navigation Page.