| maui-Shell-Lifecycle | MAUI-Shell-Routing | |
ShellContent |
ShellContent is the lowest-level element in the Shell hierarchy. It represents a single page in your app that is displayed when a tab or menu item is selected.
Shell
└── TabBar (or Flyout)
└── Tab
└── ShellContent → Your Page
<Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyApp">
<TabBar>
<Tab Title="Home" Icon="home.png">
<ShellContent Route="home"
Title="Home"
ContentTemplate="{DataTemplate local:HomePage}" />
<ShellContent Route="details"
Title="Details"
ContentTemplate="{DataTemplate local:DetailsPage}" />
</Tab>
<Tab Title="Profile" Icon="user.png">
<ShellContent Route="profile"
Title="Profile"
ContentTemplate="{DataTemplate local:ProfilePage}" />
</Tab>
</TabBar>
</Shell>
👉 : Pages are created on demand in Shell apps, in response to navigation.
👉 : When the flyout isn't open the bottom tab bar can be considered to be the top level of navigation in the app.
await Shell.Current.GoToAsync("details"); | maui-Shell-Lifecycle | MAUI-Shell-Routing | |