<Page x:Class="ReShade.Setup.Pages.StatusPage"
      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" 
      mc:Ignorable="d" 
      d:DesignWidth="510" d:DesignHeight="638"
      Width="Auto" Height="Auto">
  <Page.Resources>
    <!-- Adapted from https://stackoverflow.com/a/6369137 -->
    <Style x:Key="BusyAnimationStyle" TargetType="Control">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="Control">
            <ControlTemplate.Resources>
              <Color x:Key="FilledColor" R="155" G="155" B="155" A="255" />
              <Color x:Key="UnfilledColor" R="155" G="155" B="155" A="0" />

              <Storyboard x:Key="Animation0" BeginTime="00:00:00.0" RepeatBehavior="Forever">
                <ColorAnimationUsingKeyFrames Storyboard.TargetName="ellipse0" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                  <SplineColorKeyFrame KeyTime="00:00:00.0" Value="{StaticResource FilledColor}"/>
                  <SplineColorKeyFrame KeyTime="00:00:01.6" Value="{StaticResource UnfilledColor}"/>
                </ColorAnimationUsingKeyFrames>
              </Storyboard>

              <Storyboard x:Key="Animation1" BeginTime="00:00:00.2" RepeatBehavior="Forever">
                <ColorAnimationUsingKeyFrames Storyboard.TargetName="ellipse1" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                  <SplineColorKeyFrame KeyTime="00:00:00.0" Value="{StaticResource FilledColor}"/>
                  <SplineColorKeyFrame KeyTime="00:00:01.6" Value="{StaticResource UnfilledColor}"/>
                </ColorAnimationUsingKeyFrames>
              </Storyboard>

              <Storyboard x:Key="Animation2" BeginTime="00:00:00.4" RepeatBehavior="Forever">
                <ColorAnimationUsingKeyFrames Storyboard.TargetName="ellipse2" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                  <SplineColorKeyFrame KeyTime="00:00:00.0" Value="{StaticResource FilledColor}"/>
                  <SplineColorKeyFrame KeyTime="00:00:01.6" Value="{StaticResource UnfilledColor}"/>
                </ColorAnimationUsingKeyFrames>
              </Storyboard>

              <Storyboard x:Key="Animation3" BeginTime="00:00:00.6" RepeatBehavior="Forever">
                <ColorAnimationUsingKeyFrames Storyboard.TargetName="ellipse3" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                  <SplineColorKeyFrame KeyTime="00:00:00.0" Value="{StaticResource FilledColor}"/>
                  <SplineColorKeyFrame KeyTime="00:00:01.6" Value="{StaticResource UnfilledColor}"/>
                </ColorAnimationUsingKeyFrames>
              </Storyboard>

              <Storyboard x:Key="Animation4" BeginTime="00:00:00.8" RepeatBehavior="Forever">
                <ColorAnimationUsingKeyFrames Storyboard.TargetName="ellipse4" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                  <SplineColorKeyFrame KeyTime="00:00:00.0" Value="{StaticResource FilledColor}"/>
                  <SplineColorKeyFrame KeyTime="00:00:01.6" Value="{StaticResource UnfilledColor}"/>
                </ColorAnimationUsingKeyFrames>
              </Storyboard>

              <Storyboard x:Key="Animation5" BeginTime="00:00:01.0" RepeatBehavior="Forever">
                <ColorAnimationUsingKeyFrames Storyboard.TargetName="ellipse5" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                  <SplineColorKeyFrame KeyTime="00:00:00.0" Value="{StaticResource FilledColor}"/>
                  <SplineColorKeyFrame KeyTime="00:00:01.6" Value="{StaticResource UnfilledColor}"/>
                </ColorAnimationUsingKeyFrames>
              </Storyboard>

              <Storyboard x:Key="Animation6" BeginTime="00:00:01.2" RepeatBehavior="Forever">
                <ColorAnimationUsingKeyFrames Storyboard.TargetName="ellipse6" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                  <SplineColorKeyFrame KeyTime="00:00:00.0" Value="{StaticResource FilledColor}"/>
                  <SplineColorKeyFrame KeyTime="00:00:01.6" Value="{StaticResource UnfilledColor}"/>
                </ColorAnimationUsingKeyFrames>
              </Storyboard>

              <Storyboard x:Key="Animation7" BeginTime="00:00:01.4" RepeatBehavior="Forever">
                <ColorAnimationUsingKeyFrames Storyboard.TargetName="ellipse7" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                  <SplineColorKeyFrame KeyTime="00:00:00.0" Value="{StaticResource FilledColor}"/>
                  <SplineColorKeyFrame KeyTime="00:00:01.6" Value="{StaticResource UnfilledColor}"/>
                </ColorAnimationUsingKeyFrames>
              </Storyboard>
            </ControlTemplate.Resources>

            <ControlTemplate.Triggers>
              <Trigger Property="IsVisible" Value="True">
                <Trigger.EnterActions>
                  <BeginStoryboard Storyboard="{StaticResource Animation0}" x:Name="Storyboard0" />
                  <BeginStoryboard Storyboard="{StaticResource Animation1}" x:Name="Storyboard1"/>
                  <BeginStoryboard Storyboard="{StaticResource Animation2}" x:Name="Storyboard2"/>
                  <BeginStoryboard Storyboard="{StaticResource Animation3}" x:Name="Storyboard3"/>
                  <BeginStoryboard Storyboard="{StaticResource Animation4}" x:Name="Storyboard4"/>
                  <BeginStoryboard Storyboard="{StaticResource Animation5}" x:Name="Storyboard5"/>
                  <BeginStoryboard Storyboard="{StaticResource Animation6}" x:Name="Storyboard6"/>
                  <BeginStoryboard Storyboard="{StaticResource Animation7}" x:Name="Storyboard7"/>
                </Trigger.EnterActions>

                <Trigger.ExitActions>
                  <StopStoryboard BeginStoryboardName="Storyboard0"/>
                  <StopStoryboard BeginStoryboardName="Storyboard1"/>
                  <StopStoryboard BeginStoryboardName="Storyboard2"/>
                  <StopStoryboard BeginStoryboardName="Storyboard3"/>
                  <StopStoryboard BeginStoryboardName="Storyboard4"/>
                  <StopStoryboard BeginStoryboardName="Storyboard5"/>
                  <StopStoryboard BeginStoryboardName="Storyboard6"/>
                  <StopStoryboard BeginStoryboardName="Storyboard7"/>
                </Trigger.ExitActions>
              </Trigger>
            </ControlTemplate.Triggers>

            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
              <Grid>
                <Canvas Height="60" Width="60">
                  <Canvas.Resources>
                    <Style TargetType="Ellipse">
                      <Setter Property="Width" Value="15"/>
                      <Setter Property="Height" Value="15" />
                      <Setter Property="Fill" Value="#009B9B9B" />
                    </Style>
                  </Canvas.Resources>

                  <Ellipse x:Name="ellipse0" Canvas.Left="1.75" Canvas.Top="21"/>
                  <Ellipse x:Name="ellipse1" Canvas.Top="7" Canvas.Left="6.5"/>
                  <Ellipse x:Name="ellipse2" Canvas.Left="20.5" Canvas.Top="0.75"/>
                  <Ellipse x:Name="ellipse3" Canvas.Left="34.75" Canvas.Top="6.75"/>
                  <Ellipse x:Name="ellipse4" Canvas.Left="40.5" Canvas.Top="20.75" />
                  <Ellipse x:Name="ellipse5" Canvas.Left="34.75" Canvas.Top="34.5"/>
                  <Ellipse x:Name="ellipse6" Canvas.Left="20.75" Canvas.Top="39.75"/>
                  <Ellipse x:Name="ellipse7" Canvas.Top="34.25" Canvas.Left="7" />
                </Canvas>
              </Grid>
            </Border>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>

    <Style x:Key="PatreonButtonStyle" TargetType="Button">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="Button">
            <ControlTemplate.Triggers>
              <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Cursor" Value="Hand" />
              </Trigger>
            </ControlTemplate.Triggers>

            <Border CornerRadius="12" Background="#141518">
              <TextBlock Text="{TemplateBinding Content}" Foreground="#FFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center" />
            </Border>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
  </Page.Resources>
  <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
    <Grid>
      <Control x:Name="StatusSpin" Width="100" Height="100" Style="{StaticResource BusyAnimationStyle}" Background="Transparent" />
      <Path x:Name="StatusSuccess" Width="100" Height="100" Visibility="Collapsed" Stroke="Green" StrokeThickness="10" StrokeEndLineCap="Round" StrokeStartLineCap="Round" Data="M 20,63 L 50,80 L 80,20" />
      <Path x:Name="StatusFailure" Width="100" Height="100" Visibility="Collapsed" Stroke="Red" StrokeThickness="10" StrokeEndLineCap="Round" StrokeStartLineCap="Round" Data="M 20,20 L 80,80 M 20,80 L 80,20" />
    </Grid>
    <TextBlock x:Name="ProgressText" Margin="10,5" TextAlignment="Center" TextWrapping="Wrap" />
    <Button x:Uid="PatreonButton" x:Name="PatreonButton" Width="130" Height="25" Margin="0,20,0,0" Content="Become a patron" Style="{StaticResource PatreonButtonStyle}" Click="OnPatreonButtonClick" />
  </StackPanel>
</Page>
