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

    <Style x:Key="MahApps.Metro.Styles.FlatSlider.Track" TargetType="{x:Type RepeatButton}">
        <Setter Property="Focusable" Value="False" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid Background="{TemplateBinding Background}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  obsolete  -->
    <Style x:Key="SliderButtonStyle"
           BasedOn="{StaticResource MahApps.Metro.Styles.FlatSlider.Track}"
           TargetType="{x:Type RepeatButton}" />

    <Style x:Key="MahApps.Metro.Styles.FlatSlider.Thumb" TargetType="{x:Type Thumb}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Grid Background="{TemplateBinding Background}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  obsolete  -->
    <Style x:Key="SliderThumbStyle"
           BasedOn="{StaticResource MahApps.Metro.Styles.FlatSlider.Thumb}"
           TargetType="{x:Type Thumb}" />

    <Style x:Key="MahApps.Metro.Styles.FlatSlider.TickBar" TargetType="TickBar">
        <Setter Property="Fill" Value="{DynamicResource SliderThumbDisabled}" />
        <Setter Property="Visibility" Value="Collapsed" />
        <Style.Triggers>
            <Trigger Property="Placement" Value="Top">
                <Setter Property="Height" Value="6" />
                <Setter Property="Margin" Value="0 0 0 3" />
            </Trigger>
            <Trigger Property="Placement" Value="Bottom">
                <Setter Property="Height" Value="6" />
                <Setter Property="Margin" Value="0 3 0 0" />
            </Trigger>

            <Trigger Property="Placement" Value="Left">
                <Setter Property="Margin" Value="0 0 3 0" />
                <Setter Property="Width" Value="6" />
            </Trigger>
            <Trigger Property="Placement" Value="Right">
                <Setter Property="Margin" Value="3 0 0 0" />
                <Setter Property="Width" Value="6" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--  obsolete  -->
    <Style x:Key="SliderTickBarStyle"
           BasedOn="{StaticResource MahApps.Metro.Styles.FlatSlider.TickBar}"
           TargetType="TickBar" />

    <ControlTemplate x:Key="MahApps.Metro.Styles.FlatSlider.HorizontalTemplate" TargetType="{x:Type Slider}">
        <Grid VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" MinHeight="{TemplateBinding Slider.MinHeight}" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TickBar x:Name="TopTick"
                     Grid.Row="0"
                     Placement="Top"
                     Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.TickBar}" />
            <TickBar x:Name="BottomTick"
                     Grid.Row="2"
                     Placement="Bottom"
                     Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.TickBar}" />
            <Track x:Name="PART_Track" Grid.Row="1">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Background="{TemplateBinding Slider.Foreground}"
                                  Command="Slider.DecreaseLarge"
                                  Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.Track}" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <controls:MetroThumb Width="{TemplateBinding Slider.MinHeight}"
                                         Background="{TemplateBinding Slider.BorderBrush}"
                                         Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.Thumb}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Background="{TemplateBinding Slider.Background}"
                                  Command="Slider.IncreaseLarge"
                                  Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.Track}" />
                </Track.IncreaseRepeatButton>
            </Track>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="TickPlacement" Value="TopLeft">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="TickPlacement" Value="BottomRight">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="TickPlacement" Value="Both">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!--  obsolete  -->
    <ControlTemplate x:Key="HorizontalSlider" TargetType="{x:Type Slider}">
        <Grid VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" MinHeight="{TemplateBinding Slider.MinHeight}" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TickBar x:Name="TopTick"
                     Grid.Row="0"
                     Placement="Top"
                     Style="{StaticResource SliderTickBarStyle}" />
            <TickBar x:Name="BottomTick"
                     Grid.Row="2"
                     Placement="Bottom"
                     Style="{StaticResource SliderTickBarStyle}" />
            <Track x:Name="PART_Track" Grid.Row="1">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Background="{TemplateBinding Slider.Foreground}"
                                  Command="Slider.DecreaseLarge"
                                  Style="{StaticResource SliderButtonStyle}" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <controls:MetroThumb Width="{TemplateBinding Slider.MinHeight}"
                                         Background="{TemplateBinding Slider.BorderBrush}"
                                         Style="{StaticResource SliderThumbStyle}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Background="{TemplateBinding Slider.Background}"
                                  Command="Slider.IncreaseLarge"
                                  Style="{StaticResource SliderButtonStyle}" />
                </Track.IncreaseRepeatButton>
            </Track>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="TickPlacement" Value="TopLeft">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="TickPlacement" Value="BottomRight">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="TickPlacement" Value="Both">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="MahApps.Metro.Styles.FlatSlider.VerticalTemplate" TargetType="{x:Type Slider}">
        <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" MinWidth="{TemplateBinding Slider.MinWidth}" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TickBar x:Name="TopTick"
                     Grid.Column="0"
                     Placement="Left"
                     Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.TickBar}" />
            <TickBar x:Name="BottomTick"
                     Grid.Column="2"
                     Placement="Right"
                     Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.TickBar}" />
            <Track x:Name="PART_Track" Grid.Column="1">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Background="{TemplateBinding Slider.Foreground}"
                                  Command="Slider.DecreaseLarge"
                                  Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.Track}" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <controls:MetroThumb Height="{TemplateBinding Slider.MinWidth}"
                                         Background="{TemplateBinding Slider.BorderBrush}"
                                         Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.Thumb}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Background="{TemplateBinding Slider.Background}"
                                  Command="Slider.IncreaseLarge"
                                  Style="{DynamicResource MahApps.Metro.Styles.FlatSlider.Track}" />
                </Track.IncreaseRepeatButton>
            </Track>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="TickPlacement" Value="TopLeft">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="TickPlacement" Value="BottomRight">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="TickPlacement" Value="Both">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!--  obsolete  -->
    <ControlTemplate x:Key="VerticalSlider" TargetType="{x:Type Slider}">
        <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" MinWidth="{TemplateBinding Slider.MinWidth}" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TickBar x:Name="TopTick"
                     Grid.Column="0"
                     Placement="Left"
                     Style="{StaticResource SliderTickBarStyle}" />
            <TickBar x:Name="BottomTick"
                     Grid.Column="2"
                     Placement="Right"
                     Style="{StaticResource SliderTickBarStyle}" />
            <Track x:Name="PART_Track" Grid.Column="1">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Background="{TemplateBinding Slider.Foreground}"
                                  Command="Slider.DecreaseLarge"
                                  Style="{StaticResource SliderButtonStyle}" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <controls:MetroThumb Height="{TemplateBinding Slider.MinWidth}"
                                         Background="{TemplateBinding Slider.BorderBrush}"
                                         Style="{StaticResource SliderThumbStyle}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Background="{TemplateBinding Slider.Background}"
                                  Command="Slider.IncreaseLarge"
                                  Style="{StaticResource SliderButtonStyle}" />
                </Track.IncreaseRepeatButton>
            </Track>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="TickPlacement" Value="TopLeft">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="TickPlacement" Value="BottomRight">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
            </Trigger>
            <Trigger Property="TickPlacement" Value="Both">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible" />
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="MahApps.Metro.Styles.FlatSlider" TargetType="{x:Type Slider}">
        <Setter Property="Background" Value="{DynamicResource SliderTrackNormal}" />
        <Setter Property="BorderBrush" Value="{DynamicResource BlackBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Maximum" Value="100" />
        <Setter Property="Minimum" Value="0" />
        <Setter Property="Orientation" Value="Horizontal" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Value" Value="0" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{DynamicResource SliderTrackDisabled}" />
                <Setter Property="BorderBrush" Value="{DynamicResource SliderThumbDisabled}" />
                <Setter Property="Foreground" Value="{DynamicResource SliderValueDisabled}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource SliderTrackHover}" />
                <Setter Property="Foreground" Value="{DynamicResource AccentColorBrush2}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="MinHeight" Value="12" />
                <Setter Property="MinWidth" Value="0" />
                <Setter Property="Template" Value="{DynamicResource MahApps.Metro.Styles.FlatSlider.HorizontalTemplate}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="MinHeight" Value="0" />
                <Setter Property="MinWidth" Value="12" />
                <Setter Property="Template" Value="{DynamicResource MahApps.Metro.Styles.FlatSlider.VerticalTemplate}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--  obsolete  -->
    <Style x:Key="FlatSlider"
           BasedOn="{StaticResource MahApps.Metro.Styles.FlatSlider}"
           TargetType="{x:Type Slider}" />

</ResourceDictionary>