<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    mc:Ignorable="d">

    <Style TargetType="{x:Type ProgressBar}">
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Foreground" Value="{DynamicResource HoverBrush}"/>
        <Setter Property="Background" Value="{DynamicResource NormalBrushDark}"/>
        <Setter Property="BorderThickness" Value="{DynamicResource ControlBorderThickness}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource NormalBorderBrush}"
                            CornerRadius="{DynamicResource ControlCornerRadius}">
                        <Grid SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                            <Rectangle Fill="{TemplateBinding Background}" />
                            <Rectangle Name="PART_Track" Margin="0" />
                            <Decorator x:Name="PART_Indicator" HorizontalAlignment="Left" VerticalAlignment="Stretch">
                                <Grid>
                                    <Rectangle Fill="{TemplateBinding Foreground}" />
                                    <Grid x:Name="Animation" Visibility="Hidden">
                                        <Rectangle Fill="{TemplateBinding Background}" Margin="0,0,50,0">
                                            <Rectangle.RenderTransform>
                                                <ScaleTransform x:Name="HiderPreTransform" ScaleX="0"/>
                                            </Rectangle.RenderTransform>
                                        </Rectangle>
                                        <Rectangle Fill="{TemplateBinding Background}" RenderTransformOrigin="1, 0" Margin="50,0,0,0">
                                            <Rectangle.RenderTransform>
                                                <ScaleTransform x:Name="HiderPostTransform" ScaleX="1" />
                                            </Rectangle.RenderTransform>
                                        </Rectangle>
                                    </Grid>
                                </Grid>
                            </Decorator>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsIndeterminate" Value="True">
                            <Setter TargetName="Animation" Property="Visibility" Value="Visible" />
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard RepeatBehavior="Forever">
                                        <DoubleAnimation Storyboard.TargetName="HiderPreTransform" Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
                                                         To="1" Duration="0:00:2" AutoReverse="True"/>
                                        <DoubleAnimation Storyboard.TargetName="HiderPostTransform" Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
                                                         To="0" Duration="0:00:2" AutoReverse="True"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>