<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="using:C1.Xaml"
    mc:Ignorable="d">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/Common.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="LoadingShapeBBStyle" TargetType="c1:C1BrushBuilder">
        <Setter Property="DesignBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFA8C0D7" />
                    <GradientStop Color="#FF82AACF" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="DesignColor" Value="{StaticResource BaseColor}" />
    </Style>
    <Style x:Key="LoadingShapeBorderBBStyle" TargetType="c1:C1BrushBuilder">
        <Setter Property="DesignBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF93AdC5" Offset="0.3" />
                    <GradientStop Color="#FF88A3BC" Offset="0.5" />
                    <GradientStop Color="#FF94ADC5" Offset="0.7" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="DesignColor" Value="{StaticResource BaseColor}" />
    </Style>
    <Style x:Key="LoadingDarkShadeBBStyle" TargetType="c1:C1BrushBuilder">
        <Setter Property="DesignBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#00A8C0D7" Offset="0" />
                    <GradientStop Color="#FF9BB1C5" Offset="0.45" />
                    <GradientStop Color="#FF9BB1C5" Offset="0.55" />
                    <GradientStop Color="#0082AACF" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="DesignColor" Value="{StaticResource BaseColor}" />
    </Style>

    <Style TargetType="c1:C1ProgressIndicator">
        <Setter Property="Background" Value="#7FFFFFFF" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="HeaderForeground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="Padding" Value="5"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="HorizontalHeaderAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1ProgressIndicator">
                    <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}" Visibility="Collapsed">
                        <Grid.Resources>
                            <Storyboard x:Key="ProgressAnimation">
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                        <DiscreteObjectKeyFrame.Value>
                                            <Visibility>Visible</Visibility>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                                <Storyboard RepeatBehavior="Forever">
                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                        <SplineDoubleKeyFrame KeyTime="00:00:00.65" Value="360" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </Storyboard>
                        </Grid.Resources>
                        <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Border Background="{TemplateBinding HeaderBackground}">
                                <ContentControl IsTabStop="False" Margin="{TemplateBinding Padding}" Padding="{TemplateBinding HeaderPadding}" 
                                                FontFamily="{TemplateBinding HeaderFontFamily}" FontSize="{TemplateBinding HeaderFontSize}" 
                                                Foreground="{TemplateBinding HeaderForeground}" 
                                                HorizontalContentAlignment="{TemplateBinding HorizontalHeaderAlignment}" 
                                                VerticalContentAlignment="{TemplateBinding VerticalHeaderAlignment}">
                                    <!-- these properties failed to assign, maybe this is prohibited in WinRT due to performance reasons
                                                FontStretch="{TemplateBinding HeaderFontStretch}" 
                                                FontStyle="{TemplateBinding HeaderFontStyle}" 
                                                FontWeight="{TemplateBinding HeaderFontWeight}"-->
                                    <ContentPresenter x:Name="HeaderPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" />
                                </ContentControl>
                            </Border>
                            <c1:C1BrushBuilder x:Name="LoadingShapeBkg" Input="{TemplateBinding Foreground}" Style="{StaticResource LoadingShapeBBStyle}" />
                            <c1:C1BrushBuilder x:Name="LoadingDarkShadeBkg" Input="{TemplateBinding Foreground}" Style="{StaticResource LoadingDarkShadeBBStyle}" />
                            <c1:C1BrushBuilder x:Name="LoadingShapeBorder" Input="{TemplateBinding Foreground}" Style="{StaticResource LoadingShapeBorderBBStyle}" />
                            <Grid MaxHeight="25" MaxWidth="25" x:Name="LoadingWeel" Grid.Row="1">
                       <!--         <Ellipse StrokeThickness="1" Margin="-10" Width="45" Height="45">
                                    <Ellipse.Fill>
                                        <LinearGradientBrush>
                                            <GradientStop Color="#7FFFFFFF" Offset="0.6" />
                                            <GradientStop Color="#00FFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Ellipse.Fill>
                                </Ellipse>-->
                                <Path Data="M12.5,5.1724138 C8.4482756,5.1724138 5.1724138,8.4482756 5.1724138,12.5 C5.1724138,16.551725 8.4482756,19.827587 12.5,19.827587 C16.551725,19.827587 19.827587,16.551725 19.827587,12.5 C19.827587,8.4482756 16.551725,5.1724138 12.5,5.1724138 z M12.5,0 C19.396551,0 25,5.3448277 25,12.5 C25,19.396551 19.396551,25 12.5,25 C5.5172415,25 0,19.396551 0,12.5 C0,5.6034484 5.6034484,0 12.5,0 z" Fill="{Binding Output, ElementName=LoadingShapeBkg}" Width="25" Height="25" />
                                <Path Data="M12.5,5.1724138 C8.4482756,5.1724138 5.1724138,8.4482756 5.1724138,12.5 C5.1724138,16.551725 8.4482756,19.827587 12.5,19.827587 C16.551725,19.827587 19.827587,16.551725 19.827587,12.5 C19.827587,8.4482756 16.551725,5.1724138 12.5,5.1724138 z M12.5,0 C19.396551,0 25,5.3448277 25,12.5 C25,19.396551 19.396551,25 12.5,25 C5.5172415,25 0,19.396551 0,12.5 C0,5.6034484 5.6034484,0 12.5,0 z" Width="25" Height="25">
                                    <Path.Fill>
                                        <LinearGradientBrush>
                                            <LinearGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.2" ScaleY="1.2" />
                                                    <SkewTransform CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="0" Y="0.1" />
                                                </TransformGroup>
                                            </LinearGradientBrush.RelativeTransform>
                                            <GradientStop Color="#FFFFFFFF" Offset="1" />
                                            <GradientStop Color="#00FFFFFF" Offset="0.6" />
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                </Path>
                                <Path Data="M12.5,5.1724138 C8.4482756,5.1724138 5.1724138,8.4482756 5.1724138,12.5 C5.1724138,16.551725 8.4482756,19.827587 12.5,19.827587 C16.551725,19.827587 19.827587,16.551725 19.827587,12.5 C19.827587,8.4482756 16.551725,5.1724138 12.5,5.1724138 z M12.5,0 C19.396551,0 25,5.3448277 25,12.5 C25,19.396551 19.396551,25 12.5,25 C5.5172415,25 0,19.396551 0,12.5 C0,5.6034484 5.6034484,0 12.5,0 z" Width="25" Height="25">
                                    <Path.Fill>
                                        <LinearGradientBrush>
                                            <LinearGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.2" ScaleY="1.2" />
                                                    <SkewTransform CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="0" Y="-0.12" />
                                                </TransformGroup>
                                            </LinearGradientBrush.RelativeTransform>
                                            <GradientStop Color="#FFFFFFFF" Offset="1" />
                                            <GradientStop Color="#00FFFFFF" Offset="0.65" />
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                </Path>
                                <Path Data="M15,6.5 C10.3,6.5 6.5,10.3 6.5,15 C6.5,19.7 10.3,23.5 15,23.5 C19.7,23.5 23.5,19.7 23.5,15 C23.5,10.3 19.7,6.5 15,6.5 z M15,0.5 C23,0.5 29.5,6.7 29.5,15 C29.5,23 23,29.5 15,29.5 C6.9,29.5 0.5,23 0.5,15 C0.5,7 7,0.5 15,0.5 z" Width="30" Height="30" />
                                <Path Data="M15,6.5 C10.3,6.5 6.5,10.3 6.5,15 C6.5,19.7 10.3,23.5 15,23.5 C19.7,23.5 23.5,19.7 23.5,15 C23.5,10.3 19.7,6.5 15,6.5 z M15,0.5 C23,0.5 29.5,6.7 29.5,15 C29.5,23 23,29.5 15,29.5 C6.9,29.5 0.5,23 0.5,15 C0.5,7 7,0.5 15,0.5 z" StrokeThickness="1" Stroke="{Binding Output, ElementName=LoadingShapeBorder}" Stretch="Fill" />
                                <Path x:Name="path" Data="M12.5,5.1724138 C8.4482756,5.1724138 5.1724138,8.4482756 5.1724138,12.5 C5.1724138,16.551725 8.4482756,19.827587 12.5,19.827587 C16.551725,19.827587 19.827587,16.551725 19.827587,12.5 C19.827587,8.4482756 16.551725,5.1724138 12.5,5.1724138 z M12.5,0 C19.396551,0 25,5.3448277 25,12.5 C25,19.396551 19.396551,25 12.5,25 C5.5172415,25 0,19.396551 0,12.5 C0,5.6034484 5.6034484,0 12.5,0 z" RenderTransformOrigin="0.5,0.5" Width="25" Height="25">
                                    <Path.Fill>
                                        <LinearGradientBrush>
                                            <LinearGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="0.5" ScaleY="0.5" />
                                                    <SkewTransform CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="-0.37" Y="0" />
                                                </TransformGroup>
                                            </LinearGradientBrush.RelativeTransform>
                                            <GradientStop Color="#00FFFFFF" Offset="1" />
                                            <GradientStop Color="#FFFFFFFF" Offset="0.25" />
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                    <Path.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform />
                                            <SkewTransform />
                                            <RotateTransform />
                                            <TranslateTransform />
                                        </TransformGroup>
                                    </Path.RenderTransform>
                                </Path>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>
