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

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

    <Page.Resources>
        <ResourceDictionary>
            <Style x:Key="A_Style_FZTextBlock_Intro" TargetType="local:FZTextBlock"
                   BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="Color" Value="{StaticResource A_Color_SubHeader_Text}" />
                <Setter Property="FontSize" Value="50" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_CarName" TargetType="local:FZTextBlock"
                   BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="Color" Value="{StaticResource A_Color_SubHeader_Text}" />
                <Setter Property="FontSize" Value="95" />
            </Style>

            <Style x:Key="A_Style_FZRun_CarReward_MODEL" TargetType="local:FZRun">
                <Setter Property="FontFamily" Value="Horizon_B" />
            </Style>

            <Style x:Key="A_Style_ContentControl_Slide"
               TargetType="ContentControl"
               BasedOn="{StaticResource A_Style_ContentControl_AnimatedTagSlideFromLeft}">
                <Style.Resources>
                    <local:UIStoryboard x:Key="transition_in">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Tag"
                                                   Storyboard.TargetName="{x:Null}" 
                                                   BeginTime="0:0:0">
                            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                                Value="0.15" />
                            <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                              Value="0.0">
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <CubicEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="{x:Null}"
                                                   BeginTime="0:0:0">
                            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                Value="0.0" />
                            <EasingDoubleKeyFrame KeyTime="0:0:0.5"
                                              Value="1.0" />
                        </DoubleAnimationUsingKeyFrames>
                    </local:UIStoryboard>
                    <local:UIStoryboard x:Key="transition_out_forward"
                                    DurationOverride="0:0:0.3">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Tag"
                                                   Storyboard.TargetName="{x:Null}">
                            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                              Value="1" />
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="{x:Null}">
                            <EasingDoubleKeyFrame KeyTime="0:0:0"
                                              Value="0" />
                        </DoubleAnimationUsingKeyFrames>
                    </local:UIStoryboard>
                    <local:UIStoryboard x:Key="transition_out_back"
                                    DurationOverride="0:0:0.3">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Tag"
                                                   Storyboard.TargetName="{x:Null}">
                            <EasingDoubleKeyFrame KeyTime="0:0:0"
                                              Value="1" />
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="{x:Null}">
                            <EasingDoubleKeyFrame KeyTime="0:0:0"
                                              Value="0" />
                        </DoubleAnimationUsingKeyFrames>
                    </local:UIStoryboard>
                </Style.Resources>
                <Setter Property="Opacity"
                    Value="1" />
                <Setter Property="local:UIPageTransitionManager.TransitionIndex"
                    Value="0" />
            </Style>

            <Style x:Key="A_Style_EventFire_IntroCompleteEvent"
               TargetType="local:EventFire">
                <Style.Resources>
                    <local:UIStoryboard x:Key="transition_in">
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="EventName"
                                                   Storyboard.TargetName="{x:Null}">
                            <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="Complete" />
                        </ObjectAnimationUsingKeyFrames>                            
                    </local:UIStoryboard>
                </Style.Resources>
                <Setter Property="local:UIPageTransitionManager.TransitionIndex"
                    Value="0" />
            </Style>
        </ResourceDictionary>
    </Page.Resources>

    <Grid>
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="DefaultHelpPanel"
                    Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>

        <Border Style="{StaticResource A_Style_Border_ScenePadding_Opus}">
            <ContentControl Style="{StaticResource A_Style_ContentControl_Slide}"
                    VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="-10">
                <StackPanel Orientation="Vertical" Margin="10">
                    <local:FZTextBlock Text="{local:Loc InGame.IDS_CarReward_IntroText}"
                                   Style="{StaticResource A_Style_FZTextBlock_Intro}"
                                   Margin="0,0,0,20"/>
                    <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding CarNameText, Converter={StaticResource A_StringToUpper}}"
                                   local:TextBlockInlineMarkup.ResourceBaseName="A_Style_FZRun_CarReward_"
                                   Style="{StaticResource A_Style_FZTextBlock_CarName}" />
                </StackPanel>
            </ContentControl>
        </Border>

        <local:EventFire Style="{StaticResource A_Style_EventFire_IntroCompleteEvent}" EventName="" />
    </Grid>
</Page>
