I have a .NET MAUI application. On the main page I have a list of items and when I select one of them, I want to navigate to a different view that has tabs (Summary and Details) related to the selected item. I was wondering how to achieve this.
I was first thinking of registering the route to the tabbed page using Routing.RegisterRoute
, but then I read the TabbedPage documentation where it says that "TabbedPage is incompatible with .NET MAUI Shell apps, and an exception will be thrown if you attempt to use TabbedPage in a Shell app."
You can have two or more
TabBar
:s and switch between them using 3 slashesShell.Current.GoToAsync("///MainPage");
which will take you to the MainPage in the bar that you have declared inRoute
. Read aboutRoutes
and theShell
at .NET MAUI Shell navigationIf you want to be able to click on a tab and by doing that go to a page in another
TabBar
we can intercept the event.If we have 2
TabBar
inShell
If we now want to go to
TestView
and activateSecondBar
we need to overrideOnNavigating
in theShell
Note! If you are to use
<Tab></Tab>
they need to have a route as well and be added to the complete path.