<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1="clr-namespace:C1.WPF"
    mc:Ignorable="d">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--****************** C1ProgressBar ******************-->

    <Style TargetType="c1:C1ProgressBar">
        <Setter Property="Background" Value="#FFEFF0F1"/>
        <Setter Property="Foreground" Value="#FFA0CEE4"/>
        <Setter Property="IndeterminateForeground" Value="#FFA0CEE4"/>
        <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="CornerRadius" Value="2"/>
        <Setter Property="Maximum" Value="100"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="MinHeight" Value="5"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1ProgressBar">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="Updating" To="Determinate">
                                        <!--<Storyboard>
                                            <RepositionThemeAnimation FromHorizontalOffset="{Binding TemplateSettings.IndicatorLengthDelta, RelativeSource={RelativeSource Mode=TemplatedParent}}" TargetName="ProgressBarIndicator"/>
                                        </Storyboard>-->
                                    </VisualTransition>
                                    <VisualTransition From="Paused" To="Determinate">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.25" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ProgressBarIndicator"/>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="Indeterminate">
                                        <!--<Storyboard>
                                            <FadeInThemeAnimation TargetName="EllipseGrid"/>
                                        </Storyboard>-->
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Determinate"/>
                                <VisualState x:Name="Updating"/>
                                <VisualState x:Name="Indeterminate">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="EllipseGrid"/>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DeterminateRoot"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Error">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ProgressBarIndicator">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Paused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.25" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ProgressBarIndicator"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="EllipseGrid" Opacity="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RenderTransform>
                                <TranslateTransform/>
                            </Grid.RenderTransform>
                            <Border x:Name="B1" Grid.Column="8" RenderTransformOrigin="0.5,0.5">
                                <Border.RenderTransform>
                                    <TranslateTransform/>
                                </Border.RenderTransform>
                                <Ellipse x:Name="E1" Fill="{TemplateBinding IndeterminateForeground}" Height="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}" RenderTransformOrigin="0.5,0.5" Width="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}">
                                    <Ellipse.RenderTransform>
                                        <TranslateTransform/>
                                    </Ellipse.RenderTransform>
                                </Ellipse>
                            </Border>
                            <Rectangle Grid.Column="7" Width="{Binding TemplateSettings.EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
                            <Border x:Name="B2" Grid.Column="6" RenderTransformOrigin="0.5,0.5">
                                <Border.RenderTransform>
                                    <TranslateTransform/>
                                </Border.RenderTransform>
                                <Ellipse x:Name="E2" Fill="{TemplateBinding IndeterminateForeground}" Height="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}" RenderTransformOrigin="0.5,0.5" Width="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}">
                                    <Ellipse.RenderTransform>
                                        <TranslateTransform/>
                                    </Ellipse.RenderTransform>
                                </Ellipse>
                            </Border>
                            <Rectangle Grid.Column="5" Width="{Binding TemplateSettings.EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
                            <Border x:Name="B3" Grid.Column="4" RenderTransformOrigin="0.5,0.5">
                                <Border.RenderTransform>
                                    <TranslateTransform/>
                                </Border.RenderTransform>
                                <Ellipse x:Name="E3" Fill="{TemplateBinding IndeterminateForeground}" Height="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}" RenderTransformOrigin="0.5,0.5" Width="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}">
                                    <Ellipse.RenderTransform>
                                        <TranslateTransform/>
                                    </Ellipse.RenderTransform>
                                </Ellipse>
                            </Border>
                            <Rectangle Grid.Column="3" Width="{Binding TemplateSettings.EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
                            <Border x:Name="B4" Grid.Column="2" RenderTransformOrigin="0.5,0.5">
                                <Border.RenderTransform>
                                    <TranslateTransform/>
                                </Border.RenderTransform>
                                <Ellipse x:Name="E4" Fill="{TemplateBinding IndeterminateForeground}" Height="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}" RenderTransformOrigin="0.5,0.5" Width="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}">
                                    <Ellipse.RenderTransform>
                                        <TranslateTransform/>
                                    </Ellipse.RenderTransform>
                                </Ellipse>
                            </Border>
                            <Rectangle Grid.Column="1" Width="{Binding TemplateSettings.EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
                            <Border x:Name="B5" Grid.Column="0" RenderTransformOrigin="0.5,0.5">
                                <Border.RenderTransform>
                                    <TranslateTransform/>
                                </Border.RenderTransform>
                                <Ellipse x:Name="E5" Fill="{TemplateBinding IndeterminateForeground}" Height="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}" RenderTransformOrigin="0.5,0.5" Width="{Binding TemplateSettings.EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}">
                                    <Ellipse.RenderTransform>
                                        <TranslateTransform/>
                                    </Ellipse.RenderTransform>
                                </Ellipse>
                            </Border>
                        </Grid>
                        <Border x:Name="DeterminateRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}">
                            <Border x:Name="ProgressBarIndicator" Width="{Binding TemplateSettings.IndicatorWidth, RelativeSource={RelativeSource Mode=TemplatedParent}}" Background="{TemplateBinding Foreground}" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" CornerRadius="{TemplateBinding CornerRadius}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>