|
| 1 | +<?xml version="1.0" encoding="UTF-8" ?> |
| 2 | +<Shell |
| 3 | + x:Class="TitleBarApp.AppShell" |
| 4 | + xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 5 | + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
| 6 | + xmlns:vw="clr-namespace:TitleBarApp.Views" |
| 7 | + FlyoutBehavior="Locked"> |
| 8 | + <!-- |
| 9 | + The overall app visual hierarchy is defined here, along with navigation. |
| 10 | + Ensure atleast a Flyout item or a TabBar is defined for Shell to work |
| 11 | + --> |
| 12 | + <Shell.Resources> |
| 13 | + <!-- |
| 14 | + Define the resources to be used within this Shell visual hierarchy |
| 15 | + --> |
| 16 | + </Shell.Resources> |
| 17 | + <!-- |
| 18 | + When the Flyout is visible this defines the content to display in the flyout. |
| 19 | + FlyoutDisplayOptions="AsMultipleItems" will create a separate flyout item for each child element |
| 20 | + --> |
| 21 | + <FlyoutItem Title="No TitleBar"> |
| 22 | + <ShellContent |
| 23 | + ContentTemplate="{DataTemplate vw:MainPage}" |
| 24 | + Route="home" /> |
| 25 | + </FlyoutItem> |
| 26 | + <FlyoutItem Title="TitleBar (XAML)"> |
| 27 | + <ShellContent |
| 28 | + ContentTemplate="{DataTemplate vw:XamlPage}" |
| 29 | + Route="xaml" /> |
| 30 | + </FlyoutItem> |
| 31 | + <FlyoutItem Title="TitleBar (C#)"> |
| 32 | + <ShellContent |
| 33 | + ContentTemplate="{DataTemplate vw:CSharpPage}" |
| 34 | + Route="csharp" /> |
| 35 | + </FlyoutItem> |
| 36 | + <!-- |
| 37 | + When the Flyout is visible this will be a menu item you can tie a click behavior to |
| 38 | + --> |
| 39 | + <!-- |
| 40 | + <MenuItem |
| 41 | + Clicked="OnMenuItemClicked" |
| 42 | + Text="Logout" /> |
| 43 | + --> |
| 44 | + <!-- |
| 45 | + TabBar lets you define content that won't show up in a Flyout menu. When this content is active |
| 46 | + the flyout menu won't be available. This is useful for creating areas of the application where |
| 47 | + you don't want users to be able to navigate away from. If you would like to navigate to this |
| 48 | + content you can do so by calling |
| 49 | + await Shell.Current.GoToAsync("//login"); |
| 50 | + --> |
| 51 | + <!-- |
| 52 | + <TabBar> |
| 53 | + <ShellContent |
| 54 | + ContentTemplate="{DataTemplate local:LoginPage}" |
| 55 | + Route="login" /> |
| 56 | + </TabBar> |
| 57 | + --> |
| 58 | + <!-- Optional Templates |
| 59 | + // These may be provided inline as below or as separate classes. |
| 60 | +
|
| 61 | + // This header appears at the top of the Flyout |
| 62 | + <Shell.FlyoutHeaderTemplate> |
| 63 | + <DataTemplate> |
| 64 | + <Grid>ContentHere</Grid> |
| 65 | + </DataTemplate> |
| 66 | + </Shell.FlyoutHeaderTemplate> |
| 67 | +
|
| 68 | + // ItemTemplate is for ShellItems as displayed in a Flyout |
| 69 | + <Shell.ItemTemplate> |
| 70 | + <DataTemplate> |
| 71 | + <ContentView> |
| 72 | + Bindable Properties: Title, Icon |
| 73 | + </ContentView> |
| 74 | + </DataTemplate> |
| 75 | + </Shell.ItemTemplate> |
| 76 | +
|
| 77 | + // MenuItemTemplate is for MenuItems as displayed in a Flyout |
| 78 | + <Shell.MenuItemTemplate> |
| 79 | + <DataTemplate> |
| 80 | + <ContentView> |
| 81 | + Bindable Properties: Text, Icon |
| 82 | + </ContentView> |
| 83 | + </DataTemplate> |
| 84 | + </Shell.MenuItemTemplate> |
| 85 | +
|
| 86 | + // This footer appears at the bottom of the Flyout |
| 87 | + <Shell.FlyoutFooterTemplate> |
| 88 | + <DataTemplate> |
| 89 | + <Grid>ContentHere</Grid> |
| 90 | + </DataTemplate> |
| 91 | + </Shell.FlyoutFooterTemplate> |
| 92 | + --> |
| 93 | +</Shell> |
0 commit comments