<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"
                    xmlns:media="clr-namespace:ModernFlyouts.UI.Fluent.Media">

    <Style TargetType="Button" x:Key="ButtonRevealStyle">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Background" Value="{DynamicResource ButtonRevealBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource ButtonRevealBorderBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource ButtonRevealBorderThemeThickness}" />
        <Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="ui:FocusVisualHelper.FocusVisualMargin" Value="-3" />
        <Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="RootGrid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                        <Border
                            x:Name="Background"
                            Background="{TemplateBinding Background}"
                            CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" />
                        <Border
                            x:Name="BackgroundRevealHoverBorder"
                            Background="White"
                            CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                            media:RevealBrushHelper.RevealBrushMode="Background" />
                        <Border
                            x:Name="BackgroundRevealPressBorder"
                            Background="White"
                            CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                            media:RevealBrushHelper.RevealBrushMode="BackgroundPressed" />
                        <Border
                            x:Name="ExtraHighlight"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                            media:RevealBrushHelper.RevealBrushMode="Border" />
                        <Border
                            x:Name="Border"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                            media:RevealBrushHelper.RevealBrushMode="Border" />
                        <Border
                            x:Name="ContentBorder"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                            Padding="{TemplateBinding Padding}">
                            <ContentPresenter
                                x:Name="ContentPresenter"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                Focusable="False"
                                RecognizesAccessKey="True"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="RootGrid" Property="media:RevealBrushHelper.State" Value="PointerOver" />
                            <Setter TargetName="Background" Property="Background" Value="{DynamicResource ButtonRevealBackgroundPointerOver}" />
                            <Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ButtonRevealBorderBrushPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundPointerOver}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="RootGrid" Property="media:RevealBrushHelper.State" Value="Pressed" />
                            <Setter TargetName="Background" Property="Background" Value="{DynamicResource ButtonRevealBackgroundPressed}" />
                            <Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ButtonRevealBorderBrushPressed}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundPressed}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Background" Property="Background" Value="{DynamicResource ButtonRevealBackgroundDisabled}" />
                            <Setter TargetName="ContentBorder" Property="BorderBrush" Value="{DynamicResource ButtonRevealBorderBrushDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />

                            <Setter TargetName="ExtraHighlight" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="Border" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="HighlightedMediaButtonStyle" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
        <Setter Property="Width" Value="40" />
        <Setter Property="Height" Value="40" />
        <Setter Property="ui:ControlHelper.CornerRadius" Value="6" />
    </Style>

    <Style x:Key="MediaButtonStyle" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
        <Setter Property="Width" Value="40" />
        <Setter Property="Height" Value="40" />
        <Setter Property="ui:ControlHelper.CornerRadius" Value="6" />
        <Setter Property="Background" Value="Transparent" />
    </Style>

</ResourceDictionary>
