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

    <Style x:Key="DefaultRepeatButtonStyle" TargetType="RepeatButton">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Background" Value="{DynamicResource RepeatButtonBackground}" />
        <Setter Property="Foreground" Value="{DynamicResource RepeatButtonForeground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThemeThickness}" />
        <Setter Property="Padding" Value="{DynamicResource 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="primitives:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
        <Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
        <Setter Property="primitives:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
        <Setter Property="primitives:FocusVisualHelper.FocusVisualMargin" Value="-3" />
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <local: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}"
                                            CornerRadius="{TemplateBinding primitives:ControlHelper.CornerRadius}"
                                            Padding="{TemplateBinding Padding}"
                                            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>
                            -->
                    </local:ContentControlEx>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="ContentPresenter" Property="Background" Value="{DynamicResource RepeatButtonBackgroundPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderBrushPointerOver}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RepeatButtonForegroundPointerOver}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="ContentPresenter" Property="Background" Value="{DynamicResource RepeatButtonBackgroundPressed}" />
                            <Setter TargetName="ContentPresenter" Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderBrushPressed}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RepeatButtonForegroundPressed}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="ContentPresenter" Property="Background" Value="{DynamicResource RepeatButtonBackgroundDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderBrushDisabled}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RepeatButtonForegroundDisabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="RepeatButton" BasedOn="{StaticResource DefaultRepeatButtonStyle}" />

</ResourceDictionary>