<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ui="http://schemas.modernwpf.com/2019">
    
    <Style x:Key="LayoutTypeRadioButtonStyle" TargetType="RadioButton">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrush}" />
        <Setter Property="Padding" Value="12" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
        <Setter Property="MinWidth" Value="0" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="ui:FocusVisualHelper.FocusVisualMargin" Value="0" />
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RadioButton">
                    <Border
                        x:Name="RootGrid"
                        Background="Transparent"
                        BorderBrush="Transparent"
                        BorderThickness="2"
                 
                        SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="CheckGlyph"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                                <VisualState x:Name="Indeterminate" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>

                            <Border x:Name="CheckGlyph"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    UseLayoutRounding="False"
                                    Opacity="0"
                                    CornerRadius="2"
                                    BorderThickness="2"
                                    BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}" />

                            <ui:ContentPresenterEx x:Name="ContentPresenter"
                                                   TextElement.Foreground="{TemplateBinding Foreground}"
                                                   Margin="{TemplateBinding Padding}"
                                                   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                   Grid.Column="1"
                                                   TextWrapping="Wrap"
                                                   Focusable="False"
                                                   RecognizesAccessKey="True"
                                                   SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="ContentPresenter"
                                    Property="Foreground"
                                    Value="{DynamicResource RadioButtonForegroundPointerOver}" />
                            <Setter TargetName="CheckGlyph" Property="Opacity" Value="0.6" />

                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RadioButtonForegroundPressed}" />
                            <Setter TargetName="RootGrid" Property="Background" Value="{DynamicResource RadioButtonBackgroundPressed}" />
                            <Setter TargetName="RootGrid" Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushPressed}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RadioButtonForegroundDisabled}" />
                            <Setter TargetName="RootGrid" Property="Background" Value="{DynamicResource RadioButtonBackgroundDisabled}" />
                            <Setter TargetName="RootGrid" Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="IconOnlyButtonStyle"
           BasedOn="{StaticResource DefaultButtonStyle}"
           TargetType="Button">
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Foreground"
                Value="{DynamicResource ButtonForeground}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="Background"
                            Background="Transparent"
                            CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                            SnapsToDevicePixels="True">
                        <Border x:Name="Border"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Padding="{TemplateBinding Padding}"
                                CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
                            <ContentPresenter x:Name="ContentPresenter"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Focusable="False"
                                              RecognizesAccessKey="True"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver"
                                 Value="True">
                            <Setter TargetName="Background"
                                    Property="Background"
                                    Value="{DynamicResource ButtonBackgroundPointerOver}" />
                            <Setter TargetName="Border"
                                    Property="BorderBrush"
                                    Value="{DynamicResource ButtonBorderBrushPointerOver}" />
                        </Trigger>
                        <Trigger Property="IsPressed"
                                 Value="True">
                            <Setter TargetName="Background"
                                    Property="Background"
                                    Value="{DynamicResource ButtonBackgroundPressed}" />
                            <Setter TargetName="Border"
                                    Property="BorderBrush"
                                    Value="{DynamicResource ButtonBorderBrushPressed}" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="False">
                            <Setter TargetName="Background"
                                    Property="Background"
                                    Value="{DynamicResource ButtonBackgroundDisabled}" />
                            <Setter TargetName="Border"
                                    Property="BorderBrush"
                                    Value="{DynamicResource ButtonBorderBrushDisabled}" />
                            <Setter TargetName="ContentPresenter"
                                    Property="TextElement.Foreground"
                                    Value="{DynamicResource ButtonForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>