<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 Button-->

    <Style x:Key="ButtonDefault" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
        <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="ButtonDefault.Small" BasedOn="{StaticResource ButtonDefault}" TargetType="Button">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style BasedOn="{StaticResource ButtonDefault}" TargetType="Button"/>

    <Style x:Key="ButtonPrimary" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
    </Style>

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

    <Style x:Key="ButtonSuccess" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource SuccessBrush}"/>
    </Style>

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

    <Style x:Key="ButtonInfo" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource InfoBrush}"/>
    </Style>

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

    <Style x:Key="ButtonWarning" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource WarningBrush}"/>
    </Style>

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

    <Style x:Key="ButtonDanger" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource DangerBrush}"/>
    </Style>

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

    <!--endregion-->

    <!--region ButtonIcon-->

    <Style x:Key="ButtonIcon" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
        <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="Button">
                    <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="ButtonIcon.Small" BasedOn="{StaticResource ButtonIcon}" TargetType="Button">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="ButtonIconCircular" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="Button">
        <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="Button">
                    <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="ButtonIconCircular.Small" BasedOn="{StaticResource ButtonIconCircular}" TargetType="Button">
        <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 ButtonDashed-->

    <Style x:Key="ButtonDashed" BasedOn="{StaticResource ButtonDashedBaseStyle}" TargetType="Button">
        <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="ButtonDashed.Small" BasedOn="{StaticResource ButtonDashed}" TargetType="Button">
        <Setter Property="Height" Value="20"/>
        <Setter Property="Padding" Value="6,1"/>
        <Setter Property="hc:IconElement.Height" Value="12"/>
    </Style>

    <Style x:Key="ButtonDashedPrimary" BasedOn="{StaticResource ButtonDashedBaseStyle}" TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
    </Style>

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

    <Style x:Key="ButtonDashedSuccess" BasedOn="{StaticResource ButtonDashedBaseStyle}" TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource SuccessBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource SuccessBrush}"/>
    </Style>

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

    <Style x:Key="ButtonDashedInfo" BasedOn="{StaticResource ButtonDashedBaseStyle}" TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource InfoBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource InfoBrush}"/>
    </Style>

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

    <Style x:Key="ButtonDashedWarning" BasedOn="{StaticResource ButtonDashedBaseStyle}" TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource WarningBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource WarningBrush}"/>
    </Style>

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

    <Style x:Key="ButtonDashedDanger" BasedOn="{StaticResource ButtonDashedBaseStyle}" TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource DangerBrush}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource DangerBrush}"/>
    </Style>

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

    <!--endregion-->

    <Style x:Key="ButtonCustom" BasedOn="{StaticResource BaseStyle}" TargetType="Button">
        <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="Button">
                    <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>

    <!--region ButtonGroup-->

    <Style x:Key="ButtonGroupItemDefault" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button"/>

    <Style x:Key="ButtonGroupItemHorizontalFirst" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
        <Setter Property="hc:BorderElement.CornerRadius" Value="4,0,0,4"/>
        <Setter Property="Margin" Value="0"/>
    </Style>

    <Style x:Key="ButtonGroupItemHorizontalLast" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
        <Setter Property="hc:BorderElement.CornerRadius" Value="0,4,4,0"/>
    </Style>

    <Style x:Key="ButtonGroupItemSingle" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
        <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
    </Style>

    <Style x:Key="ButtonGroupItemVerticalFirst" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
        <Setter Property="hc:BorderElement.CornerRadius" Value="4,4,0,0"/>
        <Setter Property="Margin" Value="0"/>
    </Style>

    <Style x:Key="ButtonGroupItemVerticalLast" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
        <Setter Property="hc:BorderElement.CornerRadius" Value="0,0,4,4"/>
    </Style>

    <!--endregion-->

</ResourceDictionary>
