<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:hc="clr-namespace:HandyControl.Controls">

    <!--region RepeatButton-->

    <Style x:Key="RepeatButtonDefault" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{DynamicResource BorderBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="RepeatButtonDefault.Small" BasedOn="{StaticResource RepeatButtonDefault}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

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

    <Style x:Key="RepeatButtonPrimary" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonPrimary.Small" BasedOn="{StaticResource RepeatButtonPrimary}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonSuccess" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource SuccessBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonSuccess.Small" BasedOn="{StaticResource RepeatButtonSuccess}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonInfo" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource InfoBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonInfo.Small" BasedOn="{StaticResource RepeatButtonInfo}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonWarning" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource WarningBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonWarning.Small" BasedOn="{StaticResource RepeatButtonWarning}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonDanger" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource DangerBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonDanger.Small" BasedOn="{StaticResource RepeatButtonDanger}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <!--endregion-->

    <!--region RepeatButtonIcon-->

    <Style x:Key="RepeatButtonIcon" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
        <Setter Property="hc:BorderElement.CornerRadius" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                        <ContentControl HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <Path Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Width="{TemplateBinding hc:IconElement.Width}" Height="{TemplateBinding hc:IconElement.Height}" Data="{TemplateBinding hc:IconElement.Geometry}"/>
                        </ContentControl>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RepeatButtonIcon.Small" BasedOn="{StaticResource RepeatButtonIcon}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonIconCircular" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Width" Value="{StaticResource DefaultControlHeight}"/>
        <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
        <Setter Property="hc:BorderElement.CornerRadius" Value="0"/>
        <Setter Property="Padding" Value="6"/>
        <Setter Property="FocusVisualStyle">
            <Setter.Value>
                <Style>
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle Style="{StaticResource RectangleFocusVisualCircular}"/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Border Style="{StaticResource BorderCircular}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                        <ContentControl HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <Path Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Width="{TemplateBinding hc:IconElement.Width}" Height="{TemplateBinding hc:IconElement.Height}" Data="{TemplateBinding hc:IconElement.Geometry}"/>
                        </ContentControl>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RepeatButtonIconCircular.Small" BasedOn="{StaticResource RepeatButtonIconCircular}" TargetType="RepeatButton">
        <Setter Property="Width" Value="20"/>
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <!--endregion-->

    <!--region RepeatButtonDashed-->

    <Style x:Key="RepeatButtonDashed" BasedOn="{StaticResource RepeatButtonDashedBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="RepeatButtonDashed.Small" BasedOn="{StaticResource RepeatButtonDashed}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonDashedPrimary" BasedOn="{StaticResource RepeatButtonDashedBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonDashedPrimary.Small" BasedOn="{StaticResource RepeatButtonDashedPrimary}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonDashedSuccess" BasedOn="{StaticResource RepeatButtonDashedBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Foreground" Value="{DynamicResource SuccessBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource SuccessBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonDashedSuccess.Small" BasedOn="{StaticResource RepeatButtonDashedSuccess}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonDashedInfo" BasedOn="{StaticResource RepeatButtonDashedBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Foreground" Value="{DynamicResource InfoBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource InfoBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonDashedInfo.Small" BasedOn="{StaticResource RepeatButtonDashedInfo}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonDashedWarning" BasedOn="{StaticResource RepeatButtonDashedBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Foreground" Value="{DynamicResource WarningBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource WarningBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonDashedWarning.Small" BasedOn="{StaticResource RepeatButtonDashedWarning}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="RepeatButtonDashedDanger" BasedOn="{StaticResource RepeatButtonDashedBaseStyle}" TargetType="RepeatButton">
        <Setter Property="Foreground" Value="{DynamicResource DangerBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource DangerBrush}"/>
    </Style>

    <Style x:Key="RepeatButtonDashedDanger.Small" BasedOn="{StaticResource RepeatButtonDashedDanger}" TargetType="RepeatButton">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <!--endregion-->

    <Style x:Key="RepeatButtonCustom" BasedOn="{StaticResource BaseStyle}" TargetType="RepeatButton">
        <Setter Property="Background" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Border x:Name="Chrome" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
                        <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" Value=".9"/>
                            <Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(hc:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Opacity" Value=".6"/>
                            <Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(hc:BackgroundSwitchElement.MouseDownBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.4"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
