0
votes

When I navigate within tabbed pages, OnNavigatingTo does not fire. There are several different threads around this subject but I don't see that there is a solution? My environment is a Main Page (login) > MasterDetails Page > Tabbed Page > Child Content Page.

_navigationService.NavigateAsync("MasterDetail/Navigation/DashboardPage/Child1TabPage");

<TabbedPage.Children>
    <views:Child1TabPage/>
    <views:Child2TabPage/>
</TabbedPage.Children>  

I've tried using an additional navigation page either in the MainPage, or on the Dashboard page with useModalNavigation on or off but that doesn't work either. Like so.

navigationService.NavigateAsync("MasterDetail/Navigation/DashboardPage/NavigationTabbed/Child1TabPage", null, false, true);

or on the tabb DashboardPage like so

navigationService.NavigateAsync("NavigationTabbed/Child1TabPage", null, false, true);

Any ideas?

1
What do you mean by navigate within tabbed pages? Do you mean switching tabs by clicking on the tab headers? Do you mean calling NavigateAsync from Child1TabPageViewModel to another page? Could you be a little more clear?user5420778
Also, are you expecting it to fire on the TabbedPage, or the child content page that represents the Tab?user5420778
Brian, I'm switching tabs by clicking on the tab header and I'm expecting it to fire in the child content page.Mark Garcia
Please see the answer by Dan. This technically is not a navigation action, but rather a selection changed event. We are looking at how we can implement this and have one workaround in the issue that Dan posted.user5420778
Thanks Brian! I love Prism, thank you for making everyone's job easier.Mark Garcia

1 Answers

1
votes

There is currently no mechanism built into Prism for Xamarin Forms that would call INavigationAware on Children of any MultiPage such as the TabbedPage or CarouselPage. This is a planned enhancement for Prism for Xamarin Forms 6.3 and should be available in Preview 3. You can follow the issue here.