<UserControl
    x:Class="BasicLibrarySamples.View.ProgressIndicatorDemo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BasicLibrarySamples.View.C1ProgressIndicator"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:c1="using:C1.Xaml"
    d:DesignHeight="300"
    d:DesignWidth="400">
    
    <c1:C1UniformGrid Margin="10">
         <c1:C1ProgressIndicator IsActive="True" Header="Loading..." Foreground="Cyan" Background="White"/>
         <c1:C1ProgressIndicator IsActive="True" Foreground="White" Background="DarkSlateBlue">
            <c1:C1ProgressIndicator.Template>
                <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="snow" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                        <SplineDoubleKeyFrame KeyTime="00:00:5" Value="360" />
                                    </DoubleAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LoadingEl" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                        <SplineDoubleKeyFrame KeyTime="00:00:5" 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>
                            <Grid x:Name="LoadingEl" Grid.Row="1" RenderTransformOrigin="0.3,0.3">
                                <Grid.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform />
                                        <SkewTransform />
                                        <RotateTransform />
                                        <TranslateTransform />
                                    </TransformGroup>
                                </Grid.RenderTransform>
                                <TextBlock x:Name="snow" Text="&#x2745;" RenderTransformOrigin="0.7,0.7" FontFamily="Segoe UI Symbol" FontSize="48" Foreground="{TemplateBinding Foreground}">
                                    <TextBlock.RenderTransform>
                                        <RotateTransform />
                                    </TextBlock.RenderTransform>
                                </TextBlock>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </c1:C1ProgressIndicator.Template>
        </c1:C1ProgressIndicator>

    </c1:C1UniformGrid>
</UserControl>
