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

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Base/ProgressBarBaseStyle.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
    </Style>

    <Style x:Key="ProgressBarSuccess" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource SuccessBrush}"/>
    </Style>

    <Style x:Key="ProgressBarInfo" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource InfoBrush}"/>
    </Style>

    <Style x:Key="ProgressBarWarning" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource WarningBrush}"/>
    </Style>

    <Style x:Key="ProgressBarDanger" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource DangerBrush}"/>
    </Style>

    <Style x:Key="ProgressBarPrimaryStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground">
            <Setter.Value>
                <DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
                    <DrawingBrush.Transform>
                        <TransformGroup>
                            <RotateTransform Angle="20"/>
                            <TranslateTransform x:Name="MyTransform" X="0"/>
                        </TransformGroup>
                    </DrawingBrush.Transform>
                    <DrawingBrush.Drawing>
                        <GeometryDrawing>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                                    <GradientStop Color="{DynamicResource DarkPrimaryColor}" Offset="0"/>
                                    <GradientStop Color="{DynamicResource DarkPrimaryColor}" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="1"/>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry Rect="0,0,20,32"/>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ProgressBarSuccessStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground">
            <Setter.Value>
                <DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
                    <DrawingBrush.Transform>
                        <TransformGroup>
                            <RotateTransform Angle="20"/>
                            <TranslateTransform x:Name="MyTransform" X="0"/>
                        </TransformGroup>
                    </DrawingBrush.Transform>
                    <DrawingBrush.Drawing>
                        <GeometryDrawing>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                                    <GradientStop Color="{DynamicResource DarkSuccessColor}" Offset="0"/>
                                    <GradientStop Color="{DynamicResource DarkSuccessColor}" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="1"/>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry Rect="0,0,20,32"/>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ProgressBarInfoStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground">
            <Setter.Value>
                <DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
                    <DrawingBrush.Transform>
                        <TransformGroup>
                            <RotateTransform Angle="20"/>
                            <TranslateTransform x:Name="MyTransform" X="0"/>
                        </TransformGroup>
                    </DrawingBrush.Transform>
                    <DrawingBrush.Drawing>
                        <GeometryDrawing>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                                    <GradientStop Color="{DynamicResource DarkInfoColor}" Offset="0"/>
                                    <GradientStop Color="{DynamicResource DarkInfoColor}" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="1"/>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry Rect="0,0,20,32"/>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ProgressBarWarningStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground">
            <Setter.Value>
                <DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
                    <DrawingBrush.Transform>
                        <TransformGroup>
                            <RotateTransform Angle="20"/>
                            <TranslateTransform x:Name="MyTransform" X="0"/>
                        </TransformGroup>
                    </DrawingBrush.Transform>
                    <DrawingBrush.Drawing>
                        <GeometryDrawing>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                                    <GradientStop Color="{DynamicResource DarkWarningColor}" Offset="0"/>
                                    <GradientStop Color="{DynamicResource DarkWarningColor}" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="1"/>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry Rect="0,0,20,32"/>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ProgressBarDangerStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="ProgressBar">
        <Setter Property="Foreground">
            <Setter.Value>
                <DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
                    <DrawingBrush.Transform>
                        <TransformGroup>
                            <RotateTransform Angle="20"/>
                            <TranslateTransform x:Name="MyTransform" X="0"/>
                        </TransformGroup>
                    </DrawingBrush.Transform>
                    <DrawingBrush.Drawing>
                        <GeometryDrawing>
                            <GeometryDrawing.Brush>
                                <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                                    <GradientStop Color="{DynamicResource DarkDangerColor}" Offset="0"/>
                                    <GradientStop Color="{DynamicResource DarkDangerColor}" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="0.5"/>
                                    <GradientStop Color="White" Offset="1"/>
                                </LinearGradientBrush>
                            </GeometryDrawing.Brush>
                            <GeometryDrawing.Geometry>
                                <RectangleGeometry Rect="0,0,20,32"/>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="controls:CircleProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
    </Style>

    <Style x:Key="ProgressBarSuccessCircle" BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="controls:CircleProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource SuccessBrush}"/>
    </Style>

    <Style x:Key="ProgressBarInfoCircle" BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="controls:CircleProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource InfoBrush}"/>
    </Style>

    <Style x:Key="ProgressBarWarningCircle" BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="controls:CircleProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource WarningBrush}"/>
    </Style>

    <Style x:Key="ProgressBarDangerCircle" BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="controls:CircleProgressBar">
        <Setter Property="Foreground" Value="{DynamicResource DangerBrush}"/>
    </Style>

    <Style BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
        <Setter Property="WaveFill" Value="{DynamicResource DarkPrimaryBrush}"/>
    </Style>

    <Style x:Key="ProgressBarSuccessWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
        <Setter Property="WaveFill" Value="{DynamicResource DarkSuccessBrush}"/>
    </Style>

    <Style x:Key="ProgressBarInfoWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
        <Setter Property="WaveFill" Value="{DynamicResource DarkInfoBrush}"/>
    </Style>

    <Style x:Key="ProgressBarWarningWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
        <Setter Property="WaveFill" Value="{DynamicResource DarkWarningBrush}"/>
    </Style>

    <Style x:Key="ProgressBarDangerWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="controls:WaveProgressBar">
        <Setter Property="WaveFill" Value="{DynamicResource DarkDangerBrush}"/>
    </Style>

    <Style x:Key="ProgressBarFlat" TargetType="ProgressBar">
        <Setter Property="Height" Value="4"/>
        <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
        <Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ProgressBar">
                    <controls:SimplePanel x:Name="TemplateRoot" SnapsToDevicePixels="true">
                        <Rectangle x:Name="PART_Track" Fill="{TemplateBinding Background}" StrokeThickness="0" Stroke="{TemplateBinding BorderBrush}"/>
                        <Decorator x:Name="PART_Indicator" HorizontalAlignment="Left">
                            <Rectangle x:Name="Indicator" Fill="{TemplateBinding Foreground}"/>
                        </Decorator>
                    </controls:SimplePanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Orientation" Value="Vertical">
                            <Setter Property="LayoutTransform" TargetName="TemplateRoot">
                                <Setter.Value>
                                    <RotateTransform Angle="-90"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>