<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_Title}"
               TargetType="local:FZTextBlock"
               x:Key="A_Style_FZTextBlock_InstructionText">
            <Setter Property="FontSize"
                    Value="46" />
            <Setter Property="Color"
                    Value="{StaticResource A_Color_SubHeader_Text}" />
        </Style>
        <Storyboard x:Key="TransitionIn" />
        <Storyboard x:Key="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="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="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="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" />

        <String x:Key="A_String_Format_Narration_3">{0} {1} {2}</String>
        <String x:Key="A_String_Format_Narration_2">{0} {1}</String>                          

        <Style x:Key="A_Style_ControllerButtonControl_ActivationButton_EventType"
           BasedOn="{StaticResource A_Style_ControllerButtonControl_ActivationButton}"
           TargetType="local:ControllerButtonControl">
            <Setter Property="InputOverride" Value="{Binding ActivateCommand}" />
            <Setter Property="local:ScreenReader.LineType" Value="NotificationPrompt"/>
            <Setter Property="local:ScreenReader.Event" Value="OnChange"/>                
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsRaceEncounter}" Value="False">
                    <Setter Property="local:MultiStringFormatter.Param1" Value="{Binding Source={local:Loc RaceEncounters.IDS_Interact_Prompt}}"/>
                    <Setter Property="local:MultiStringFormatter.Param2" Value=""/>
                    <Setter Property="local:MultiStringFormatter.Format" Value="{StaticResource A_String_Format_Narration_2}"/>
                    <Setter Property="local:ScreenReader.Line" Value="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding IsRaceEncounter}" Value="True">                    
                    <Setter Property="local:MultiStringFormatter.Param1" Value="{Binding Source={local:Loc GameOptions2.IDS_ScoringType_RaceEncounter}}"/>
                    <Setter Property="local:MultiStringFormatter.Param2" Value="{Binding RaceDifficultyText}"/>
                    <Setter Property="local:MultiStringFormatter.Format" Value="{StaticResource A_String_Format_Narration_3}"/>
                    <Setter Property="local:ScreenReader.Line" Value="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"/>
                </DataTrigger>
            </Style.Triggers>            
        </Style>

    </Page.Resources>
    <Page.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource Focus}" />
            <BeginStoryboard Storyboard="{StaticResource 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">
                <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_EventType}" 
                                                   local:MultiStringFormatter.Param0="{Binding ScreenReaderName, RelativeSource={RelativeSource Self}}"
                                                   
                                                   />
                                                                                                    
                    <local:FZTextBlock Margin="10,0,0,3"
                                       x:Name="PrompText"
                                       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="{local:Loc RaceEncounters.IDS_Interact_Prompt}" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </FrameworkElement.Style>
                    </local:FZTextBlock>
                </StackPanel>
            </ContentControl>
        </StackPanel>
    </UniformGrid>
</Page>
