<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ModernWpf.Controls"
    xmlns:ui="http://schemas.modernwpf.com/2019">

    <ui:SharedSizeGroupConverter x:Key="SharedSizeGroupConverter" />

    <Style TargetType="local:RadioMenuItem">
        <Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemForeground}" />
        <Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForeground}" />
        <Setter Property="Padding" Value="{DynamicResource MenuFlyoutItemThemePaddingNarrow}" />
        <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="ScrollViewer.PanningMode" Value="Both" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RadioMenuItem">
                    <ControlTemplate.Resources>
                        <StreamGeometry x:Key="RadioBullet">M 10 6.25 C 10.514322 6.25 11 6.347656 11.455078 6.542969 C 11.910807 6.738281 12.30957 7.006836 12.651367 7.348633 C 12.993164 7.69043 13.261719 8.089193 13.457031 8.544922 C 13.652344 9 13.75 9.485678 13.75 10 C 13.75 10.520834 13.652344 11.007487 13.457031 11.459961 C 13.261719 11.912436 12.993164 12.30957 12.651367 12.651367 C 12.30957 12.993164 11.910807 13.261719 11.455078 13.457031 C 11 13.652344 10.514322 13.75 10 13.75 C 9.479166 13.75 8.992513 13.652344 8.540039 13.457031 C 8.087564 13.261719 7.69043 12.993164 7.348633 12.651367 C 7.006836 12.30957 6.738281 11.912436 6.542969 11.459961 C 6.347656 11.007487 6.25 10.520834 6.25 10 C 6.25 9.485678 6.347656 9 6.542969 8.544922 C 6.738281 8.089193 7.006836 7.69043 7.348633 7.348633 C 7.69043 7.006836 8.087564 6.738281 8.540039 6.542969 C 8.992513 6.347656 9.479166 6.25 10 6.25 Z</StreamGeometry>
                    </ControlTemplate.Resources>
                    <Border
                        x:Name="LayoutRoot"
                        SnapsToDevicePixels="true"
                        Padding="{TemplateBinding Padding}"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        Margin="{DynamicResource MenuFlyoutItemMargin}"
                        CornerRadius="{TemplateBinding CornerRadius}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition SharedSizeGroup="{TemplateBinding Visibility, Converter={StaticResource SharedSizeGroupConverter}, ConverterParameter=MenuItemCheckColumnGroup}" Width="Auto" />
                                <ColumnDefinition SharedSizeGroup="{TemplateBinding Visibility, Converter={StaticResource SharedSizeGroupConverter}, ConverterParameter=MenuItemIconColumnGroup}" Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <ui:FontIconFallback
                                x:Name="CheckGlyph"
                                FontFamily="{DynamicResource SymbolThemeFontFamily}"
                                Data="{StaticResource RadioBullet}"
                                FontSize="12"
                                Foreground="{DynamicResource MenuFlyoutSubItemChevron}"
                                Opacity="0"
                                Margin="0,0,16,0" />
                            <Viewbox x:Name="IconRoot"
                                Grid.Column="1"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center"
                                Width="16"
                                Height="16"
                                Margin="0,0,12,0">
                                <ContentPresenter x:Name="IconContent"
                                    ContentSource="Icon"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Viewbox>
                            <TextBlock
                                x:Name="TextBlock"
                                Grid.Column="2"
                                Text="{TemplateBinding Header}"
                                Foreground="{TemplateBinding Foreground}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                            <TextBlock x:Name="KeyboardAcceleratorTextBlock"
                                Grid.Column="3"
                                Style="{DynamicResource CaptionTextBlockStyle}"
                                Text="{TemplateBinding InputGestureText}"
                                Margin="24,0,0,0"
                                Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"
                                HorizontalAlignment="Right"
                                VerticalAlignment="Center" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Icon" Value="{x:Null}">
                            <Setter Property="Visibility" TargetName="IconRoot" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="InputGestureText" Value="">
                            <Setter Property="Visibility" TargetName="KeyboardAcceleratorTextBlock" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="CheckGlyph" Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger Property="IsHighlighted" Value="True">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutSubItemBackgroundPointerOver}" />
                            <Setter TargetName="TextBlock" Property="Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPointerOver}" />
                            <Setter TargetName="CheckGlyph" Property="Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPointerOver}" />
                            <Setter TargetName="IconContent" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPointerOver}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutSubItemBackgroundPressed}" />
                            <Setter TargetName="TextBlock" Property="Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundPressed}" />
                            <Setter TargetName="CheckGlyph" Property="Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundPressed}" />
                            <Setter TargetName="IconContent" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundPressed}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="TextBlock" Property="Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundDisabled}" />
                            <Setter TargetName="CheckGlyph" Property="Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundDisabled}" />
                            <Setter TargetName="IconContent" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>