<UserControl x:Class="Txgy.Controls.Loading"
             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:local="clr-namespace:Txgy.Controls" xmlns:sys="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d" 
             d:DesignHeight="100" d:DesignWidth="100">
    <UserControl.Resources>
        <sys:Double x:Key="EW">6</sys:Double>
        <sys:Double x:Key="EH">6</sys:Double>
        <KeySpline x:Key="keySpline">0.1,0.4,0.9,0.6</KeySpline>
        <Storyboard x:Key="keyFrameStoryboard1">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="e1" Storyboard.TargetProperty="Opacity" RepeatBehavior="Forever">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="rt1" Storyboard.TargetProperty="Angle" RepeatBehavior="Forever">
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:2.5" Value="360" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:5" Value="720" KeySpline="{StaticResource keySpline}"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="720"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="e2" Storyboard.TargetProperty="Opacity" BeginTime="0:0:0.2" RepeatBehavior="Forever">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="rt2" Storyboard.TargetProperty="Angle" BeginTime="0:0:0.2" RepeatBehavior="Forever">
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:2.5" Value="360" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:5" Value="720" KeySpline="{StaticResource keySpline}"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="720"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="e3" Storyboard.TargetProperty="Opacity" BeginTime="0:0:0.4" RepeatBehavior="Forever">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="rt3" Storyboard.TargetProperty="Angle" BeginTime="0:0:0.4" RepeatBehavior="Forever">
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:2.5" Value="360" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:5" Value="720" KeySpline="{StaticResource keySpline}"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="720"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="e4" Storyboard.TargetProperty="Opacity" BeginTime="0:0:0.6" RepeatBehavior="Forever">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="rt4" Storyboard.TargetProperty="Angle" BeginTime="0:0:0.6" RepeatBehavior="Forever">
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:2.5" Value="360" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:5" Value="720" KeySpline="{StaticResource keySpline}"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="720"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="e5" Storyboard.TargetProperty="Opacity" BeginTime="0:0:0.8" RepeatBehavior="Forever">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="rt5" Storyboard.TargetProperty="Angle" BeginTime="0:0:0.8" RepeatBehavior="Forever">
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:2.5" Value="360" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:5" Value="720" KeySpline="{StaticResource keySpline}"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="720"/>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="e6" Storyboard.TargetProperty="Opacity" BeginTime="0:0:1" RepeatBehavior="Forever">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="rt6" Storyboard.TargetProperty="Angle" BeginTime="0:0:1" RepeatBehavior="Forever">
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:2.5" Value="360" KeySpline="{StaticResource keySpline}"/>
                <SplineDoubleKeyFrame KeyTime="0:0:5" Value="720" KeySpline="{StaticResource keySpline}"/>
                <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="720"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="UserControl.Loaded">
            <BeginStoryboard Storyboard="{StaticResource keyFrameStoryboard1}"/>
        </EventTrigger>
    </UserControl.Triggers>
    <Grid Height="60">
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <!--#region 动画-->
        <Grid Height="30" Width="30">
            <Border RenderTransformOrigin="0.5,0.5">
                <Border.RenderTransform>
                    <RotateTransform Angle="0" x:Name="rt1"/>
                </Border.RenderTransform>
                <Ellipse Fill="Orange" Width="{StaticResource EW}" Height="{StaticResource EH}" VerticalAlignment="Bottom" Name="e1"/>
            </Border>
            <Border RenderTransformOrigin="0.5,0.5">
                <Border.RenderTransform>
                    <RotateTransform Angle="0" x:Name="rt2"/>
                </Border.RenderTransform>
                <Ellipse Fill="Orange" Width="{StaticResource EW}" Height="{StaticResource EH}" VerticalAlignment="Bottom" Name="e2"/>
            </Border>
            <Border RenderTransformOrigin="0.5,0.5">
                <Border.RenderTransform>
                    <RotateTransform Angle="0" x:Name="rt3"/>
                </Border.RenderTransform>
                <Ellipse Fill="Orange" Width="{StaticResource EW}" Height="{StaticResource EH}" VerticalAlignment="Bottom" Name="e3"/>
            </Border>
            <Border RenderTransformOrigin="0.5,0.5">
                <Border.RenderTransform>
                    <RotateTransform Angle="0" x:Name="rt4"/>
                </Border.RenderTransform>
                <Ellipse Fill="Orange" Width="{StaticResource EW}" Height="{StaticResource EH}" VerticalAlignment="Bottom" Name="e4"/>
            </Border>
            <Border RenderTransformOrigin="0.5,0.5">
                <Border.RenderTransform>
                    <RotateTransform Angle="0" x:Name="rt5"/>
                </Border.RenderTransform>
                <Ellipse Fill="Orange" Width="{StaticResource EW}" Height="{StaticResource EH}" VerticalAlignment="Bottom" Name="e5"/>
            </Border>
            <Border RenderTransformOrigin="0.5,0.5">
                <Border.RenderTransform>
                    <RotateTransform Angle="0" x:Name="rt6"/>
                </Border.RenderTransform>
                <Ellipse Fill="Orange" Width="{StaticResource EW}" Height="{StaticResource EH}" VerticalAlignment="Bottom" Name="e6"/>
            </Border>
        </Grid>
        <!--#endregion-->
        <!--#region 提示信息-->
        <!--<TextBlock Text="{Binding Message,RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}}"
                   Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#333"
                   Margin="0,10"/>-->
        <!--#endregion-->
        
        <!--#region 取消操作-->
        <TextBlock Grid.Column="2" Margin="0,10" Foreground="Orange" VerticalAlignment="Center" HorizontalAlignment="Center"
                   Visibility="Collapsed">
            <Hyperlink Command="{Binding CancelLoadingCommand}">取消</Hyperlink>
        </TextBlock>
        <!--#endregion-->
    </Grid>
</UserControl>
