-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Enhancement] Support for Series Navigation within Shell Tabs #10810
Comments
Some of the route strings there might be wrong, but you get the idea I hope. |
This is definitely a scenario I would like to light up!! What would the user see if your shell was defined like this? <TabBar Route="tabs">
<Tab Title="Page1" Route="page1" Icon="page1.png">
<ShellContent ContentTemplate="{DataTemplate local:Page1}" />
</Tab>
<Tab Title="Page2" Route="page2" Icon="page2.png">
<ShellContent Route="page2A" ContentTemplate="{DataTemplate local:Page2A}">
<ShellContent Route="page2B" ContentTemplate="{DataTemplate local:Page2B}" />
</ShellContent>
<ShellContent Route="page5A" ContentTemplate="{DataTemplate local:Page5A}">
</ShellContent>
</Tab>
<Tab Title="Page3" Route="page3" Icon="page3.png">
<ShellContent ContentTemplate="{DataTemplate local:Page3}" />
</Tab>
</TabBar> Would the top tabs still be visible? I have some thoughts around this I posted in the spec over here Enable ShellElement navigation scenariosCurrently with shell you can only push ContentPages but the user should be able to push everything and anything. This will also allow you to better articulate at what level you want a navigation to occur. Right now whenever you push a ContentPage the NavigationStack is always relative to a bottom tab. Once we enable shell types to be pushable those can push at different levels
|
I think that the top tabs are intuitive for the parallel case only. Nested The parallel case naturally suggests top tabs, I don't think the series case should come with any automatic UI. |
Sorry I missed the altered XAML. In that instance:
That doesn't sound like a very nice user experience! But that type of flexibility will make |
Cool!! I'm excited we're thinking along the same lines for this one And this is definitely how I'd like this all to work Once I get this PR merged That'll start making stuff like this easier |
That's great! Bright future for Shell. |
Summary
Regarding
TabBar
navigation: if there are multipleShellContent
Items within aTab
, this automatically results in a topTabBar
so the user can navigate between them. This representsShellContent
items in parallel. I'd like to be able to haveShellContent
items in series within a singleTab
.That's the idea up for discussion - the rest of this post is one possible way it could work. The attraction is that depth of navigation (e.g. third level routing) could then be described in the same convenient xaml format. That's what I like most about Shell.
API Changes
An example of the XAML for TabBar as it currently stands (note Tab for Page2 in particular):
The following illustrates my proposal (note Tab for Page2 in particular):
In the second example, I propose that page2B would be:
Intended Use Case
Suppose a button click somewhere in the
page1 tab
should showPage2B
, but it should do so in the context of thepage2 tab
. CallingGoToAsync("tabs/page2/page2A/page2B")
would set thepage2 tab
active and also showPage2B
as the content. The user could then still use thepage1
tab bar button to return to the previous view.This is useful where the ViewModel for Page2B is affected by functionality in other tabs.
This Behaviour Today
The only way I've found to produce this behaviour currently is:
GoToAsync("tabs/page2");
(Shell).CurrentItem.Navigation.PushAsync(Page2B);
This has worked really well so far, but it doesn't allow for the convenience of keeping my navigation hierarchy defined in a single place (i.e.
AppShell.xaml
)The text was updated successfully, but these errors were encountered: