Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions docs/fundamentals/shell/flyout.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: ".NET MAUI Shell flyout"
description: "Learn how to customize and control a .NET MAUI flyout, which is the optional root menu for a .NET MAUI Shell app."
ms.date: 08/30/2024
ms.date: 11/28/2025
---

# .NET MAUI Shell flyout
Expand Down Expand Up @@ -180,8 +180,9 @@ The default <xref:Microsoft.Maui.Controls.DataTemplate> used for each <xref:Micr
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor"
Value="{AppThemeBinding Light=Black, Dark=White}" />
<Setter TargetName="FlyoutItemLayout"
Property="BackgroundColor"
Value="{AppThemeBinding Light=#1A000000, Dark=#1AFFFFFF}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
Expand Down Expand Up @@ -209,19 +210,12 @@ The default <xref:Microsoft.Maui.Controls.DataTemplate> used for each <xref:Micr
<Label x:Name="FlyoutItemLabel"
Grid.Column="1"
Text="{Binding Title}"
TextColor="{OnPlatform Android={AppThemeBinding Light=#DE000000, Dark=White}}"
FontSize="{OnPlatform Android=14, iOS=14}"
FontAttributes="{OnPlatform iOS=Bold}"
HorizontalOptions="{OnPlatform WinUI=Start}"
HorizontalTextAlignment="{OnPlatform WinUI=Start}"
VerticalTextAlignment="Center">
<Label.TextColor>
<OnPlatform x:TypeArguments="Color">
<OnPlatform.Platforms>
<On Platform="Android"
Value="{AppThemeBinding Light=Black, Dark=White}" />
</OnPlatform.Platforms>
</OnPlatform>
</Label.TextColor>
<Label.Margin>
<OnPlatform x:TypeArguments="Thickness">
<OnPlatform.Platforms>
Expand All @@ -243,6 +237,9 @@ The default <xref:Microsoft.Maui.Controls.DataTemplate> used for each <xref:Micr
</DataTemplate>
```

> [!IMPORTANT]
> When combining `OnPlatform` with `AppThemeBinding`, avoid nesting `AppThemeBinding` inside an `<OnPlatform>` element with `x:TypeArguments="Color"`, as this can cause type cast errors at runtime on Android. Instead, use the inline markup extension syntax as shown above, or apply colors directly using style classes.

This template can be used for as a basis for making alterations to the existing flyout layout, and also shows the visual states that are implemented for flyout items.

In addition, the <xref:Microsoft.Maui.Controls.Grid>, <xref:Microsoft.Maui.Controls.Image>, and <xref:Microsoft.Maui.Controls.Label> elements all have `x:Name` values and so can be targeted with the Visual State Manager. For more information, see [Set state on multiple elements](~/user-interface/visual-states.md#set-state-on-multiple-elements).
Expand Down