mauimaui-windows.net-maui.shell

Set the color of vertical bar in a Flyour menu item


In my .NET MAUI 8.0 app, I can't find the property to set the colour of the vertical bar in the shell flyout menu item as shown in the picture below. The image is from a sample MAUI app (ShellFlyoutSample), on Windows.

enter image description here

On Andrdoid, there is not such vertical bar in the shell flyout menu.

What is the property linked to this feature ?

This question looks similar, but I can't find a equivalent property for the Shell Flyout Menu Item. Have you already done this ?


Solution

  • You can set its color in the Platforms/Windows/App.xaml:

    <maui:MauiWinUIApplication
        x:Class="ShellFlyoutSample.WinUI.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:maui="using:Microsoft.Maui"
        xmlns:local="using:MauiAppTst.WinUI">
    
        <maui:MauiWinUIApplication.Resources>
            <StaticResource x:Key="NavigationViewSelectionIndicatorForeground" ResourceKey="SystemControlForegroundAccentBrush" />
            <SolidColorBrush x:Key="SystemControlForegroundAccentBrush"  Color="Red" />
            // you can set the other color such as blue/transparent
        </maui:MauiWinUIApplication.Resources>
    </maui:MauiWinUIApplication>