<Page HorizontalAlignment="Center"
      RenderTransformOrigin="0.5,0.5"
      VerticalAlignment="Stretch"
      mc:Ignorable="d"
      x:Name="page"
      x:Class="ForzaUI.Scenes.Anthem.AR_RaceEncounterActivation"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:ForzaUI"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Page.Resources>
        <Style BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}"
               TargetType="local:FZTextBlock"
               x:Key="A_Style_FZTextBlock_InstructionText">
            <Setter Property="FontSize"
                    Value="36" />
            <Setter Property="Color"
                    Value="{StaticResource A_Color_SubHeader_Text}" />
        </Style>
        <Storyboard x:Key="PART_TransitionIn" />
        <Storyboard x:Key="PART_Focus">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root"
                                           Storyboard.TargetProperty="Tag">
                <EasingDoubleKeyFrame KeyTime="0"
                                      Value="1" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.36"
                                      Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseInOut" />
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root"
                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="PART_Blur">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root"
                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                <EasingDoubleKeyFrame KeyTime="0:0:0.36"
                                      Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseIn" />
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="PART_Activated">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root"
                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                <EasingDoubleKeyFrame KeyTime="0:0:0.36"
                                      Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseIn" />
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="PART_A_Storyboard_AR_Abandon">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root"
                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                <EasingDoubleKeyFrame KeyTime="0:0:0.36"
                                      Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseIn" />
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <BooleanAnimationUsingKeyFrames Storyboard.TargetName="page"
                                            Storyboard.TargetProperty="DataContext.Complete">
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.36"
                                         Value="True" />
            </BooleanAnimationUsingKeyFrames>
        </Storyboard>

        <DropShadowEffect x:Key="A_Effect_ActivationTextDropShadow"
                          Color="{StaticResource A_Color_DropShadow}"
                          BlurRadius="0"
                          ShadowDepth="4" />

    </Page.Resources>
    <Page.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource PART_Focus}" />
            <BeginStoryboard Storyboard="{StaticResource PART_Blur}" />
        </EventTrigger>
    </Page.Triggers>
    <UniformGrid Rows="2">
        <Decorator />
        <StackPanel Orientation="Vertical"
                    VerticalAlignment="Top"
                    HorizontalAlignment="Center">
            <ContentControl Margin="0,-15,0,0"
                            Style="{StaticResource A_Style_ContentControl_AnimatedTagSlideFromTop}"
                            x:Name="Root">
                <Grid>
                    <local:FZMaterial x:Name="PromptAndTextBackground"
                                Style="{StaticResource A_Style_ControllerButton_Background}"
                                Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
                                Visibility="{StaticResource A_Visibility_ShowForHighContrastOnly}" 
                                Margin="3,20,6,20"/>
                    <StackPanel Margin="10,20"
                                Orientation="Horizontal">
                        <local:ControllerButtonControl Height="42"
                                                       VerticalAlignment="Center"
                                                       UseLargeIcon="True"
                                                       Margin="-4,0,0,0"
                                                       Style="{StaticResource A_Style_ControllerButtonControl_ActivationButton}" 
                                                       Command="{Binding ActivateCommand}"
                                                       InputOverride="{x:Null}"
                                                       local:MultiStringFormatter.Format="{local:Loc Main.IDS_ScreenReader_Format_ButtonControl_NameAndDescription}"
                                                       local:MultiStringFormatter.Param0="{Binding ScreenReaderName, RelativeSource={RelativeSource Self}}"
                                                       local:MultiStringFormatter.Param1="{Binding Text, ElementName=ActionText}"
                                                       local:ScreenReader.LineType="ButtonBar"
                                                       local:ScreenReader.Event="OnLoad"
                                                       local:ScreenReader.Line="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}" />
                        <Decorator LayoutTransform="{StaticResource A_SkewTransform_HUD_Italics}">
                            <local:FZTextBlock x:Name="ActionText" 
                                               Margin="0,2,8,3"
                                               TextAlignment="Center"
                                               VerticalAlignment="Center"
                                               Effect="{StaticResource A_Effect_ActivationTextDropShadow}">
                                <FrameworkElement.Style>
                                    <Style TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_InstructionText}">
                                        <Setter Property="Text" Value="{Binding RaceDifficultyText}" />
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding RaceDifficultyText}" Value="{x:Null}">
                                                <Setter Property="Text" Value="{Binding InteractionText}" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </FrameworkElement.Style>
                            </local:FZTextBlock>
                        </Decorator>
                    </StackPanel>
                </Grid>
            </ContentControl>
        </StackPanel>
    </UniformGrid>
</Page>
