<Page
    x:Class="FastNotFluid.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FastNotFluid"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Gray">
        <Canvas SizeChanged="OnCanvasSizeChanged"
                Margin="0 0 96 96">
            <Ellipse Name="ellipse"
                     Width="96"
                     Height="96" />
        </Canvas>
    </Grid>
    
    <Page.Triggers>
        <EventTrigger>
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation x:Name="horzAnima"
                                     Storyboard.TargetName="ellipse"
                                     Storyboard.TargetProperty="(Canvas.Left)"
                                     From="0" Duration="0:0:2.51"
                                     AutoReverse="True"
                                     RepeatBehavior="Forever" />

                    <DoubleAnimation x:Name="vertAnima"
                                     Storyboard.TargetName="ellipse"
                                     Storyboard.TargetProperty="(Canvas.Top)"
                                     From="0" Duration="0:0:1.01"
                                     AutoReverse="True"
                                     RepeatBehavior="Forever" />
                    
                    <ObjectAnimationUsingKeyFrames
                                        Storyboard.TargetName="ellipse"
                                        Storyboard.TargetProperty="Visibility"
                                        RepeatBehavior="Forever">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="Collapsed" />
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="Visible" />
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="Collapsed" />
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.45" Value="Visible" />
                    </ObjectAnimationUsingKeyFrames>
                    
                    <ObjectAnimationUsingKeyFrames
                                        Storyboard.TargetName="ellipse"
                                        Storyboard.TargetProperty="Fill"
                                        RepeatBehavior="Forever">
                        <DiscreteObjectKeyFrame KeyTime="0:0:0" 
                            Value="{StaticResource ApplicationPageBackgroundThemeBrush}" />
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.2" 
                            Value="{StaticResource ApplicationForegroundThemeBrush}" />
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.4" 
                            Value="{StaticResource ApplicationPressedForegroundThemeBrush}" />
                        <DiscreteObjectKeyFrame KeyTime="0:0:0.6" 
                            Value="{StaticResource ApplicationPageBackgroundThemeBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Page.Triggers>
</Page>
