<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:local="clr-namespace:ModernWpf.Controls">

    <Thickness x:Key="HyperlinkButtonPadding">0,6,0,7</Thickness>

    <Style TargetType="local:HyperlinkButton">
        <Setter Property="Background" Value="{DynamicResource HyperlinkButtonBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForeground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource HyperlinkButtonBorderThemeThickness}" />
        <Setter Property="Padding" Value="{StaticResource HyperlinkButtonPadding}" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
        <Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="FocusVisualMargin" Value="-3" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:HyperlinkButton">
                    <ui:ContentControlEx
                        x:Name="ContentPresenter"
                        Background="{TemplateBinding Background}"
                        Foreground="{TemplateBinding Foreground}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Content="{TemplateBinding Content}"
                        ContentTemplate="{TemplateBinding ContentTemplate}"
                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                        ContentStringFormat="{TemplateBinding ContentStringFormat}"
                        Padding="{TemplateBinding Padding}"
                        CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                        RecognizesAccessKey="True"
                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <!-- TODO
                            <contract7Present:ContentPresenter.BackgroundTransition>
                                <contract7Present:BrushTransition Duration="0:0:0.083" />
                            </contract7Present:ContentPresenter.BackgroundTransition>
                            -->
                    </ui:ContentControlEx>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="Background" Value="{DynamicResource HyperlinkButtonBackgroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrushPointerOver}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundPressed}" />
                            <Setter TargetName="ContentPresenter" Property="Background" Value="{DynamicResource HyperlinkButtonBackgroundPressed}" />
                            <Setter TargetName="ContentPresenter" Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrushPressed}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="Background" Value="{DynamicResource HyperlinkButtonBackgroundDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrushDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="true">
                <Setter Property="Cursor" Value="Hand" />
            </Trigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>