<Page x:Class="ForzaUI.Scenes.Anthem.A_Splash"
      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"
      xmlns:local="clr-namespace:ForzaUI"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <Page.Resources>
        <ResourceDictionary>
            <BitmapImage x:Key="A_ImageSource_Logo_Vert" UriSource="/Textures/Data_Bound/Anthem/Icons/Anthem-Logo-Vert.png" />
            <BitmapImage x:Key="A_ImageSource_Logo_Vert_CHS" UriSource="/Textures/Data_Bound/Anthem/Icons/Anthem-Logo-Vert-zhCN.png" />

            <Style x:Key="A_Style_FZTextBlock_WelcomeBase" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}" TargetType="local:FZTextBlock">
                <Setter Property="FontSize" Value="24"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_Welcome" BasedOn="{StaticResource A_Style_FZTextBlock_WelcomeBase}" TargetType="local:FZTextBlock">
                <Setter Property="Color" Value="#FFFFFFFF" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_WelcomeGamertag" BasedOn="{StaticResource A_Style_FZTextBlock_WelcomeBase}" TargetType="local:FZTextBlock">
                <Setter Property="Color" Value="#FFFFFFFF" />
            </Style>

            <Storyboard x:Key="A_Storyboard_IdleState">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HelpButton">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoadingControl">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Welcome">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_LoadingState">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HelpButton">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoadingControl">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                                
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Welcome">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)" Storyboard.TargetName="Welcome">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="-20.0"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <PowerEase EasingMode="EaseOut" Power="2" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_PopupShowingState">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HelpButton">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoadingControl">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Welcome">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="TitleLogo">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0" />
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_TransitionToLoadingState">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HelpButton">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoadingControl">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Welcome">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="1"/>
                </DoubleAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="TitleLogo">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.5"
                                          Value="0" />
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Fader">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1" />
                </DoubleAnimationUsingKeyFrames>

                <StringAnimationUsingKeyFrames Storyboard.TargetName="EventFire" Storyboard.TargetProperty="(local:EventFire.EventName)">
                    <DiscreteStringKeyFrame KeyTime="0:0:0.5" Value="TransitionToLoadingComplete"/>
                </StringAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_TransitionToLoadingWithPopupShowingState">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="HelpButton">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoadingControl">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Welcome">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                </DoubleAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="TitleLogo">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.5"
                                          Value="0" />
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Fader">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1" />
                </DoubleAnimationUsingKeyFrames>

                <StringAnimationUsingKeyFrames Storyboard.TargetName="EventFire" Storyboard.TargetProperty="(local:EventFire.EventName)">
                    <DiscreteStringKeyFrame KeyTime="0:0:0.5" Value="TransitionToLoadingComplete"/>
                </StringAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_MainMenuState">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="HelpButton">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="0" />
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="LoadingControl">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="0" />
                </DoubleAnimationUsingKeyFrames>

                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="TitleLogo">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="0" />
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="PART_List">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1" />
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="Welcome">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1" />
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <System:Double x:Key="A_Double_LogoHeight">268</System:Double>
            <System:Double x:Key="A_Double_LogoHeight_CHS">300</System:Double>

            <Style x:Key="A_Style_FZMaterial_Logo"
                   TargetType="local:FZMaterial">
                <Setter Property="ImageSource"
                        Value="{local:LocalizedResource A_ImageSource_Logo_Vert}" />
                <Setter Property="Height"
                        Value="{local:LocalizedResource A_Double_LogoHeight}" />
            </Style>

            <Style x:Key="A_Style_FrameworkElement_SplashFadeOnlyTransition" 
                    TargetType="{x:Type FrameworkElement}" 
                    BasedOn="{StaticResource A_Style_FrameworkElement_FadeOnlyTransition_0}">
                <Style.Resources>
                    <local:UIStoryboard x:Key="transition_out_forward">
                    </local:UIStoryboard>
                    <local:UIStoryboard x:Key="transition_out_back">
                    </local:UIStoryboard>
                </Style.Resources>
            </Style>
        </ResourceDictionary>
    </Page.Resources>

    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_NoAudio}"/>
    </local:UIPageTransitionManager.TransitionManager>

    <Grid x:Name="LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="States">
                <VisualState x:Name="IdleState"
                             Storyboard="{StaticResource A_Storyboard_IdleState}" />
                <VisualState x:Name="LoadingState"
                             Storyboard="{StaticResource A_Storyboard_LoadingState}" />
                <VisualState x:Name="PopupShowingState"
                             Storyboard="{StaticResource A_Storyboard_PopupShowingState}" />
                <VisualState x:Name="TransitionToLoadingState"
                             Storyboard="{StaticResource A_Storyboard_TransitionToLoadingState}" />
                <VisualState x:Name="TransitionToLoadingWithPopupShowingState"
                             Storyboard="{StaticResource A_Storyboard_TransitionToLoadingWithPopupShowingState}" />
                <VisualState x:Name="MainMenuState"
                             Storyboard="{StaticResource A_Storyboard_MainMenuState}" />
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <local:FZMaterial x:Name="BlackBG" Color="Black" />
        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <MediaElement x:Name="Video" Style="{StaticResource A_Style_ScreenSize}" />
        </Grid>

        <Grid Style="{StaticResource A_Style_FrameworkElement_SplashFadeOnlyTransition}">
            <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
                <Decorator x:Name="Welcome" Margin="94, 0, 0, 83" Opacity="0" VerticalAlignment="Bottom">
                    <Decorator.RenderTransform>
                        <TransformGroup>
                            <TranslateTransform />
                        </TransformGroup>
                    </Decorator.RenderTransform>
                    <StackPanel Orientation="Horizontal" RenderTransformOrigin="0.5, 0.5" RenderTransform="{StaticResource A_Transform_Italic}">
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Welcome}" Text="{local:Loc Main.IDS_Welcome}" Visibility="{Binding Gamertag, Converter={StaticResource A_StringVisConverter}}" Margin="0,0,8,0" />
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WelcomeGamertag}" Text="{Binding Gamertag, Converter={StaticResource A_StringToUpper}}" />
                    </StackPanel>
                </Decorator>


                <local:FZMaterialGlassCapture />

                <ContentControl Style="{StaticResource A_Style_ContentControl_BottomRight}" Margin="0, 0, 67, 77">
                    <StackPanel>
                        <local:FZMaterial x:Name="TitleLogo" Style="{StaticResource A_Style_FZMaterial_Logo}"
                              local:ScreenReader.Line="{local:Loc Main.IDS_GameTitle_ScreenReader}"
                              local:ScreenReader.Event="OnLoad"
                              local:ScreenReader.LineType="ScreenTitle" />
                        <Grid Width="326" HorizontalAlignment="Center"  Margin="0, 15, 0, 0"
                              local:MultiStringFormatter.Format="{local:Loc Main.IDS_Press_To_Start_ScreenReader}"
                              local:MultiStringFormatter.Param0="{Binding ScreenReaderName, ElementName=ControllerButton}"
                              local:ScreenReader.Line="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"
                              local:ScreenReader.Event="OnLoad"
                              local:ScreenReader.LineType="ScreenDescription">
                            <StackPanel x:Name="HelpButton" Orientation="Horizontal" HorizontalAlignment="Center" >
                                    <Decorator RenderTransformOrigin="0.5,0.5" RenderTransform="{StaticResource A_Transform_Italic}">
                                        <local:FZTextBlock Text="{Binding PressStartLeftText}" Style="{StaticResource A_Style_Text_LoadingSmall}" />
                                    </Decorator>
                                    <local:ControllerButtonControl x:Name="ControllerButton" Button="A" Style="{StaticResource A_Style_ControllerButtonControl_Default_ShowAlways}" MinWidth="26" Height="26" Margin="9,-4,0,-4"/>
                                    <Decorator RenderTransformOrigin="0.5,0.5" RenderTransform="{StaticResource A_Transform_Italic}">
                                        <local:FZTextBlock Text="{Binding PressStartRightText}" Style="{StaticResource A_Style_Text_LoadingSmall}" Margin="8,0,0,0" />
                                    </Decorator>
                                </StackPanel>

                                <Control x:Name="LoadingControl" Opacity="0" Style="{StaticResource A_Style_Control_LoadingMini}" Margin="0,0,0,0"/>
                            </Grid>
                    </StackPanel>
                </ContentControl>

                <local:CommonListBox Style="{StaticResource A_Style_ListBox_TextMenu_Default}"
                                     x:Name="PART_List"
                                     Width="396"
                                     VerticalAlignment="Bottom"
                                     HorizontalAlignment="Right"
                                     ItemContainerStyle="{StaticResource A_Style_ListBoxItem_TextMenu_Default}"
                                     ItemsSource="{Binding BootOptions}"
                                     Margin="75,82"
                                     SelectedIndex="{Binding SelectedIndex, Mode=OneWayToSource}"/>

                <!-- Only appears on PC Splash -->
                <local:FZTextBlock Text="{Binding Version}"
                                   Visibility="{Binding Version, Converter={StaticResource A_StringVisConverter}}"
                                   Color="#AAFFFFFF"
                                   HorizontalAlignment="Left"
                                   VerticalAlignment="Bottom"
                                   Margin="10,10"
                                   FontSize="18" />

                <local:FZMaterial x:Name="Fader" Color="Black" Opacity="0" IsHitTestVisible="False"/>
                <local:EventFire x:Name="EventFire" />
            </Grid>
        </Grid>
    </Grid>
</Page>
