ShellContent is the Shell element that connects a navigable Shell item to page content. Its Title labels the page, ContentTemplate supplies the page, and Route provides a navigation name. section 7.5.3
Assign a ContentPage through a DataTemplate so the page loads only when navigated to. This can reduce startup overhead when pages have many dependencies. section 7.5.3
Tabs for an inventory app
Place ShellContent inside Tab elements to expose pages as tabs: <Tab Title="Input"><ShellContent ContentTemplate="{DataTemplate pages:InputPage}" /></Tab>. A Reports tab can reference ReportPage in the same way. section 7.5.3
Listing 7.9 AppShell.xaml
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="MauiStockTake.Maui.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pages="clr-namespace:MauiStockTake.Maui.Pages"
xmlns:local="clr-namespace:MauiStockTake.Maui">
<TabBar>
<Tab Title="Input" #1
Icon="icon_input.svg"> #2
<ShellContent ContentTemplate="{
DataTemplate pages:InputPage}" /> #3
</Tab>
<Tab Title="Reports"
Icon="icon_report.svg">
<ShellContent ContentTemplate="{DataTemplate pages:ReportPage}" />
</Tab>
</TabBar>
</Shell>
Inspect the complete AppShell.xaml example, including InputPage and ReportPage ShellContent declarations inside a TabBar. section 7.5.3
