<Page x:Class="ForzaUI.Scenes.Anthem.A_PhotoAnalysis"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      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"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}">

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

    <Page.Resources>
        <ResourceDictionary>
            <Color x:Key="A_BackgroundColor">#1d1f20</Color>

            <Color x:Key="A_GreenEntryColor">#90ff6e</Color>

            <Color x:Key="MidLightGrayColor">#FFB3B3B3</Color>
            <SolidColorBrush x:Key="MidLightGrayBrush"
                             Color="{StaticResource MidLightGrayColor}" />

            <Color x:Key="A_WhiteLineDividerColor">#30F5F5F5</Color>

            <Style x:Key="A_Style_FZTextBlock_CategorySubHeaders"
                   TargetType="local:FZTextBlock"
                   BasedOn="{StaticResource A_Style_FZTextBlock_Heading_Small}">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_SubHeader_Text}" />
                <Setter Property="FontSize"
                        Value="50" />
                <Setter Property="TextWrapping"
                        Value="Wrap" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_CarsCollected"
                   TargetType="local:FZTextBlock">
                <Setter Property="VerticalAlignment"
                        Value="Top" />
                <Setter Property="FontFamily"
                        Value="Horizon_B" />
                <Setter Property="FontSize"
                        Value="78" />
                <Setter Property="Color"
                        Value="{StaticResource A_Color_SubHeader_Text}" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_CarsCollected_FirstNum"
                   TargetType="local:FZTextBlock"
                   BasedOn="{StaticResource A_Style_FZTextBlock_CarsCollected}">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_CreditTokenCost}" />
            </Style>

            <Storyboard x:Key="A_Storyboard_IEHidden">
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                               Storyboard.TargetName="ContentControl_SceneTitle">
                    <DiscreteObjectKeyFrame KeyTime="0"
                                            Value="{x:Static Visibility.Collapsed}" />
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                               Storyboard.TargetName="NewCarsPhotoGraphedPanel">
                    <DiscreteObjectKeyFrame KeyTime="0"
                                            Value="{x:Static Visibility.Collapsed}" />
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                               Storyboard.TargetName="NextBonusContainer">
                    <DiscreteObjectKeyFrame KeyTime="0"
                                            Value="{x:Static Visibility.Collapsed}" />
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                               Storyboard.TargetName="IEContent">
                    <DiscreteObjectKeyFrame KeyTime="0"
                                            Value="{x:Static Visibility.Visible}" />
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>

            <!-- Do not change the names of these Duration & EasingFunction resources; they are accessed directly by name from HUDSkillTokenControl. -->
            <Duration x:Key="A_Duration_NewCarListItem">0:0:0.32</Duration>
            <QuadraticEase x:Key="A_EasingFunction_NewCarListItem"
                           EasingMode="EaseInOut" />

            <Style x:Key="A_Style_FZTextBlock_MissionText"
                   TargetType="local:FZTextBlock"
                   BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
                <Setter Property="VerticalAlignment"
                        Value="Center" />
                <Setter Property="HorizontalAlignment"
                        Value="Left" />
                <Setter Property="TextAlignment"
                        Value="Left" />
                <Setter Property="Margin"
                        Value="0, 0, 0, 0" />
                <Setter Property="TextWrapping"
                        Value="NoWrap" />
                <Setter Property="Stretch"
                        Value="Uniform" />
                <Setter Property="StretchDirection"
                        Value="DownOnly" />
                <Setter Property="FontSize"
                        Value="42" />
                <Setter Property="Color"
                        Value="{StaticResource A_Color_SubHeader_Text}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_PromoStamp"
                   TargetType="local:FZMaterial">
                <Setter Property="Width"
                        Value="256" />
                <Setter Property="Height"
                        Value="256" />
                <Setter Property="Margin"
                        Value="0,0,0,0" />
                <Setter Property="ImageSource"
                        Value="/ForzaUI;component/Textures/Anthem/Icons/Horizon_Promo_Stamp.png" />
            </Style>

            <Style x:Key="A_Style_TextBlock_InactiveTitle_Placeholder"
                   TargetType="{x:Type TextBlock}"
                   BasedOn="{StaticResource A_Style_TextBlock_SubHeading_Button}" />

            <Style x:Key="A_Style_FZTextBlock_PhotoAnalysisCarList"
                   TargetType="{x:Type local:FZTextBlock}"
                   BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="FontSize"
                        Value="24" />
                <Setter Property="HorizontalAlignment"
                        Value="Left" />
                <Setter Property="VerticalAlignment"
                        Value="Center" />
                <Setter Property="Color"
                        Value="{StaticResource A_Color_SubHeader_Text}" />
            </Style>

            <Style x:Key="A_Style_ListBox_List_PhotoAnalysisCarList"
                   TargetType="{x:Type local:CommonListBox}"
                   BasedOn="{StaticResource A_Style_ListBox_List_Default}">
                <Setter Property="KeyboardNavigation.DirectionalNavigation"
                        Value="None" />
            </Style>

            <DataTemplate x:Key="A_DataTemplate_PhotoAnalysisCarList_Item">
                <Grid x:Name="CarItemGrid">
                    <Grid.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform />
                            <SkewTransform />
                            <RotateTransform />
                            <TranslateTransform />
                        </TransformGroup>
                    </Grid.RenderTransform>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="120" />
                    </Grid.ColumnDefinitions>

                    <local:EventFire x:Name="EventFire" />
                    <local:AudioEvent x:Name="ItemAppearAudioEvent" />

                    <local:FZTextBlock x:Name="CarNameNormal"
                                       Grid.Column="0"
                                       Text="{Binding CarName}"
                                       Style="{StaticResource A_Style_FZTextBlock_PhotoAnalysisCarList}" />

                    <!-- Green entry -->
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="Left"
                                Grid.Column="1">
                        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Icons/CRIcon/CR_64_Round.png"
                                          Width="34"
                                          Height="34"
                                          Color="{StaticResource A_Color_CreditTokenCost}"
                                          Visibility="{Binding ShowCredits, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
                        <local:FZTextBlock x:Name="Payment"
                                           Margin="10,0,0,0"
                                           Text="{Binding Payment}"
                                           Style="{StaticResource A_Style_FZTextBlock_PhotoAnalysisCarList}" />
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsAnimating}"
                                 Value="True">
                        <DataTrigger.EnterActions>
                            <BeginStoryboard>
                                <BeginStoryboard.Storyboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="0:0:0.375"
                                                                       Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
                                                                       Storyboard.TargetName="CarItemGrid">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="-50" />
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                                                  Value="5">
                                                <EasingDoubleKeyFrame.EasingFunction>
                                                    <CubicEase EasingMode="EaseIn" />
                                                </EasingDoubleKeyFrame.EasingFunction>
                                            </EasingDoubleKeyFrame>
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.375"
                                                                  Value="0">
                                                <EasingDoubleKeyFrame.EasingFunction>
                                                    <CubicEase EasingMode="EaseIn" />
                                                </EasingDoubleKeyFrame.EasingFunction>
                                            </EasingDoubleKeyFrame>
                                        </DoubleAnimationUsingKeyFrames>
                                        <BooleanAnimationUsingKeyFrames Duration="0:0:0.305"
                                                                        Storyboard.TargetProperty="DataContext.IsAnimating">
                                            <DiscreteBooleanKeyFrame KeyTime="0:0:0.305"
                                                                     Value="False" />
                                        </BooleanAnimationUsingKeyFrames>
                                        <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)"
                                                                       Storyboard.TargetName="EventFire">
                                            <DiscreteStringKeyFrame KeyTime="0:0:0.305"
                                                                    Value="AddPayment" />
                                        </StringAnimationUsingKeyFrames>
                                        <StringAnimationUsingKeyFrames Storyboard.TargetName="ItemAppearAudioEvent"
                                                                       Storyboard.TargetProperty="(local:AudioEvent.SoundName)">
                                            <DiscreteStringKeyFrame KeyTime="0:0:0.0"
                                                                    Value="" />
                                            <DiscreteStringKeyFrame KeyTime="0:0:0.05"
                                                                    Value="/Master/UI/Promo/HZ2_SFX_HUD_Promo_InfoScreenItemAppear_01" />
                                        </StringAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard.Storyboard>
                            </BeginStoryboard>
                        </DataTrigger.EnterActions>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ShowGreen}"
                                 Value="True">
                        <Setter Property="Color"
                                Value="{StaticResource A_GreenEntryColor}"
                                TargetName="CarNameNormal" />
                        <Setter Property="Color"
                                Value="{StaticResource A_GreenEntryColor}"
                                TargetName="Payment" />
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <Style x:Key="A_Style_ListBoxItem_PhotoAnalysisCarList"
                   TargetType="{x:Type ListBoxItem}">
                <Setter Property="FocusVisualStyle"
                        Value="{x:Null}" />
                <Setter Property="Focusable"
                        Value="False" />

                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <StackPanel ClipToBounds="True">
                                <ContentPresenter Height="52" />
                                <local:FZMaterial Color="{StaticResource A_WhiteLineDividerColor}"
                                                  Style="{StaticResource A_Style_FZMaterial_Panel_HorizontalDivider}"
                                                  VerticalAlignment="Bottom"
                                                  HorizontalAlignment="Stretch" />
                            </StackPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Storyboard x:Key="A_Storyboard_ProcessingFade">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                               Storyboard.TargetName="BackgroundFader">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1.0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.75"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                    <EasingDoubleKeyFrame KeyTime="0:0:5.0"
                                          Value="0.7">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_ProcessingComplete">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                               Storyboard.TargetName="ProcessingPhotoText">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1.0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.15"
                                          Value="0.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                               Storyboard.TargetName="ProcessingCompletePhotoText">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="0.0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.15"
                                          Value="0.0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <!-- Change this to use glass once its in -->
            <!--<Storyboard x:Key="A_Storyboard_ScreenCompleted">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundFader">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0.7"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="0.7">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn"/>
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>-->

            <Storyboard x:Key="A_Storyboard_TotalPayment">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
                                               Storyboard.TargetName="PaymentTotal">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1.15" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.385"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
                                               Storyboard.TargetName="PaymentTotal">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1.15" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.385"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_CurrentBonusProgressCurrentNum">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
                                               Storyboard.TargetName="CurrentBonusProgressCurrentNum">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1.15" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.525"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
                                               Storyboard.TargetName="CurrentBonusProgressCurrentNum">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1.15" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.525"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_NextBonusProgressCurrentNum">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
                                               Storyboard.TargetName="NextBonusProgressCurrentNum">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1.15" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.525"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
                                               Storyboard.TargetName="NextBonusProgressCurrentNum">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="1.15" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.525"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_BonusAchieved">
                <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(local:FZTextBlock.Color)"
                                              Storyboard.TargetName="CurrentBonusProgressCurrentNum">
                    <EasingColorKeyFrame KeyTime="0:0:0.0"
                                         Value="{StaticResource A_GreenEntryColor}" />
                </ColorAnimationUsingKeyFrames>
                <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(local:FZTextBlock.Color)"
                                              Storyboard.TargetName="CurrentBonusProgressOutOfSlash">
                    <EasingColorKeyFrame KeyTime="0:0:0.0"
                                         Value="{StaticResource A_GreenEntryColor}" />
                </ColorAnimationUsingKeyFrames>
                <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(local:FZTextBlock.Color)"
                                              Storyboard.TargetName="CurrentBonusProgressOutOf">
                    <EasingColorKeyFrame KeyTime="0:0:0.0"
                                         Value="{StaticResource A_GreenEntryColor}" />
                </ColorAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
                                               Storyboard.TargetName="PromoStamp">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="2.0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.525"
                                          Value="0.95">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.57"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
                                               Storyboard.TargetName="PromoStamp">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="2.0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.525"
                                          Value="0.95">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.57"
                                          Value="1.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                               Storyboard.TargetName="PromoStamp">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="0.0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.57"
                                          Value="0.3">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <StringAnimationUsingKeyFrames Storyboard.TargetName="EventFire"
                                               Storyboard.TargetProperty="(local:EventFire.EventName)">
                    <DiscreteStringKeyFrame KeyTime="0:0:1.2"
                                            Value="AchievementComplete" />
                </StringAnimationUsingKeyFrames>
                <StringAnimationUsingKeyFrames Storyboard.TargetName="ItemAppearAudioEvent"
                                               Storyboard.TargetProperty="(local:AudioEvent.SoundName)">
                    <DiscreteStringKeyFrame KeyTime="0:0:0.0"
                                            Value="" />
                    <DiscreteStringKeyFrame KeyTime="0:0:0.0"
                                            Value="/Master/UI/Promo/HZ2_SFX_HUD_Promo_BonusStamp_01" />
                </StringAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_PresentNextBonus">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Tag"
                                               Storyboard.TargetName="CurrentBonusPanel">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                          Value="0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                          Value="1">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Tag"
                                               Storyboard.TargetName="NextBonusPanel">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.4"
                                          Value="1" />
                    <EasingDoubleKeyFrame KeyTime="0:0:1.0375"
                                          Value="0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseOut" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                               Storyboard.TargetName="PromoStamp">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.075"
                                          Value="0.3">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseOut" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.45"
                                          Value="0.0">
                        <EasingDoubleKeyFrame.EasingFunction>
                            <CubicEase EasingMode="EaseIn" />
                        </EasingDoubleKeyFrame.EasingFunction>
                    </EasingDoubleKeyFrame>
                </DoubleAnimationUsingKeyFrames>
                <StringAnimationUsingKeyFrames Storyboard.TargetName="EventFire"
                                               Storyboard.TargetProperty="(local:EventFire.EventName)">
                    <DiscreteStringKeyFrame KeyTime="0:0:1.8375"
                                            Value="BonusAnimationComplete" />
                </StringAnimationUsingKeyFrames>
                <StringAnimationUsingKeyFrames Storyboard.TargetName="ItemAppearAudioEvent"
                                               Storyboard.TargetProperty="(local:AudioEvent.SoundName)">
                    <DiscreteStringKeyFrame KeyTime="0:0:0.0"
                                            Value="" />
                    <DiscreteStringKeyFrame KeyTime="0:0:0.1"
                                            Value="/Master/UI/PostRace/HZ2_SFX_HUD_PostRace_XPRewardsXPBarAppear_01" />
                </StringAnimationUsingKeyFrames>
            </Storyboard>

            <Style x:Key="A_Style_FZTextBlock_AnalysisTitle"
                   TargetType="local:FZTextBlock">
                <Setter Property="FontFamily"
                        Value="Horizon_A" />
                <Setter Property="Color"
                        Value="{StaticResource A_Color_SubHeader_Text}" />
                <Setter Property="FontSize"
                        Value="42" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_TotalPayment"
                   TargetType="local:FZTextBlock">
                <Setter Property="FontFamily"
                        Value="Horizon_A" />
                <Setter Property="Color"
                        Value="{StaticResource A_Color_SubHeader_Text}" />
                <Setter Property="FontSize"
                        Value="36" />
            </Style>

        </ResourceDictionary>
    </Page.Resources>

    <Grid x:Name="LayoutRoot"
          Opacity="1">

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="PromoStates">
                <VisualState x:Name="EnabledState" />
                <VisualState x:Name="IEState"
                             Storyboard="{StaticResource A_Storyboard_IEHidden}" />
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <local:FZMaterial x:Name="BackgroundFader"
                          Opacity="0.8"
                          Color="{StaticResource A_BackgroundColor}" />

        <local:FZMaterialGlassCapture />


        <!-- Helper button bar -->
        <ContentControl x:Name="BottomBar"
                        Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="DefaultHelpPanel"
                            local:ControllerButtonPanel.ADescription="{local:Loc HelpButtons.IDS_Continue}"
                            Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>

        <Border Style="{StaticResource A_Style_Border_ScenePadding}">

            <Grid Margin="20">

                <StackPanel>
                    <ContentControl x:Name="ContentControl_SceneTitle"
                                    Content="{local:Loc ScreenTitles.IDS_PhotoAnalysis}"
                                    Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                    local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/Photo.png"
                                    VerticalAlignment="Top"
                                    HorizontalAlignment="Left" />

                    <StackPanel Margin="0,45,0,0"
                                Orientation="Horizontal">
                        <Decorator x:Name="NewCarsPhotoGraphedPanel"
                                   HorizontalAlignment="Left"
                                   VerticalAlignment="Top"
                                   Width="675">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <StackPanel>
                                    <Grid Margin="0,0,0,23">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_AnalysisTitle}"
                                                           Grid.Column="0"
                                                           Text="{local:Loc PhotoCollection.IDS_CarsPhotographedTitle}" />
                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_AnalysisTitle}"
                                                           HorizontalAlignment="Right"
                                                           Grid.Column="1"
                                                           Text="{local:Loc PhotoCollection.IDS_CarsPhotographedPayment}" />
                                    </Grid>

                                    <local:FZMaterial Grid.Column="2"
                                                      Style="{StaticResource A_Style_FZMaterial_Panel_HorizontalDivider}"
                                                      Color="{StaticResource A_WhiteLineDividerColor}"
                                                      VerticalAlignment="Bottom"
                                                      HorizontalAlignment="Stretch" />
                                    <Canvas Height="325" ClipToBounds="True" Margin="0,0,0,53">
                                        <local:CommonListBox x:Name="PART_PhotoAnalysisCarList"
                                                             Style="{StaticResource A_Style_ListBox_List_PhotoAnalysisCarList}"
                                                             ItemTemplate="{StaticResource A_DataTemplate_PhotoAnalysisCarList_Item}"
                                                             ItemContainerStyle="{StaticResource A_Style_ListBoxItem_PhotoAnalysisCarList}"
                                                             ItemsSource="{Binding Collection}"
                                                             Canvas.Top="0"
                                                             Width="{Binding ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType=Canvas}}"/>
                                    </Canvas>
                                </StackPanel>

                                <StackPanel Grid.Row="1"
                                            Margin="0,48,0,0"
                                            Orientation="Vertical"
                                            HorizontalAlignment="Right">
                                    <local:FZTextBlock Margin="0,0,0,14"
                                                       HorizontalAlignment="Right"
                                                       Text="{local:Loc PhotoCollection.IDS_PhotoTotalPayment}"
                                                       Style="{StaticResource A_Style_FZTextBlock_TotalPayment}" />

                                    <StackPanel Height="80" Orientation="Horizontal"
                                          RenderTransformOrigin="0.5,0.5"
                                          HorizontalAlignment="Right"
                                          x:Name="PaymentTotal">
                                        <StackPanel.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform />
                                                <SkewTransform />
                                                <RotateTransform />
                                                <TranslateTransform />
                                            </TransformGroup>
                                        </StackPanel.RenderTransform>
                                        <local:FZMaterial Color="{StaticResource A_Color_CreditTokenCost}"
                                    		ImageSource="/ForzaUI;component/Textures/Anthem/Icons/CRIcon/CR_128_Round.png"
                                    		Width="60" Margin="0,10,5,10" />
                                        <local:FZTextBlock Style="{StaticResource A_Style_TextBlock_CarSelect_Cost}"
                                                           Color="{StaticResource A_Color_CreditTokenCost}"
                                    		Text="{Binding TotalPayment, ConverterParameter=money, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}, FallbackValue=0}" Margin="0,18" />
                                    </StackPanel>

                                    <Grid Margin="0,58,0,0">
                                        <StackPanel Orientation="Horizontal"
                                                    x:Name="ProcessingPhotoText">
                                            <ProgressBar IsIndeterminate="True"
                                                         Style="{StaticResource A_Style_ProgressBar_WaitSpinner}" />
                                            <local:FZTextBlock TextAlignment="Right"
                                                               VerticalAlignment="Center"
                                                               Text="{local:Loc PhotoCollection.IDS_ProcessingPhoto}"
                                                               Style="{StaticResource A_Style_FZTextBlock_CategorySubHeaders}"
                                                               FontSize="58"
                                                               Margin="10,0,0,0" />
                                        </StackPanel>
                                        <local:FZTextBlock x:Name="ProcessingCompletePhotoText"
                                                           Opacity="0"
                                                           TextAlignment="Right"
                                                           VerticalAlignment="Center"
                                                           Text="{local:Loc PhotoCollection.IDS_ProcessingComplete}"
                                                           Style="{StaticResource A_Style_FZTextBlock_CategorySubHeaders}"
                                                           FontSize="58" />
                                    </Grid>
                                </StackPanel>
                            </Grid>

                        </Decorator>

                        <Grid Margin="197,0,0,0"
                              HorizontalAlignment="Left"
                              >
                            <local:FZMaterial Margin="195,150,0,0"
                                              x:Name="PromoStamp"
                                              Style="{StaticResource A_Style_FZMaterial_PromoStamp}"
                                              Color="{StaticResource A_GreenEntryColor}"
                                              Opacity="0"
                                              RenderTransformOrigin="0.5,0.5">
                                <local:FZMaterial.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform />
                                        <SkewTransform />
                                        <RotateTransform />
                                        <TranslateTransform />
                                    </TransformGroup>
                                </local:FZMaterial.RenderTransform>
                            </local:FZMaterial>

                            <Grid x:Name="NextBonusContainer"
                                  HorizontalAlignment="Left"
                                  VerticalAlignment="Top"
                                  Margin="0,-10,-10,-10">
                                <StackPanel Margin="0,10,10,10"
                                            Orientation="Horizontal"
                                            Height="379">
                                    <local:FZMaterial Margin="0,0,30,0"
                                                      Style="{StaticResource A_Style_FZMaterial_Panel_VerticalDivider}"
                                                      Color="{StaticResource A_WhiteLineDividerColor}"
                                                      VerticalAlignment="Stretch"
                                                      HorizontalAlignment="Left" />

                                    <DockPanel LastChildFill="True">
                                        <local:FZTextBlock HorizontalAlignment="Left"
                                                           Text="{local:Loc PhotoCollection.IDS_NextCaptureBonus_Title}"
                                                           Style="{StaticResource A_Style_FZTextBlock_AnalysisTitle}" 
                                                           DockPanel.Dock="Top"/>
                                        <Grid>
                                            <ContentControl x:Name="CurrentBonusPanel"
                                                            Style="{StaticResource A_Style_ContentControl_AnimatedTagSlideFromLeft}"
                                                            Margin="-10">
                                                <Grid Margin="10">
                                                    <StackPanel Orientation="Horizontal"
                                                                Margin="0, 23, 0, 0"
                                                                VerticalAlignment="Top">
                                                        <local:FZTextBlock x:Name="CurrentBonusMissionTextBefore"
                                                                           Style="{StaticResource A_Style_FZTextBlock_MissionText}"
                                                                           Text="{local:Loc PhotoCollection.IDS_BonusMissionBeforeText}" />
                                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_MissionText}"
                                                                           Color="{StaticResource A_Color_CreditTokenCost}"
                                                                           Text="{Binding CurrentBonusProgressOutOf}"
                                                                           Margin="5,0,5,0" />
                                                        <local:FZTextBlock x:Name="CurrentBonusMissionTextAfter"
                                                                           Style="{StaticResource A_Style_FZTextBlock_MissionText}"
                                                                           Text="{local:Loc PhotoCollection.IDS_BonusMissionAfterText}" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Vertical"
                                                                VerticalAlignment="Bottom">
                                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TotalPayment}"
                                                                           Text="{local:Loc PhotoCollection.IDS_NextCaptureBonus_Bonus}"
                                                                           Margin="0,0,0,16"/>
                                                        <StackPanel Orientation="Horizontal"
                                                              Height="80"
                                                              Margin="-5,0,0,39">
                                                            <local:FZMaterial Color="{StaticResource A_Color_CreditTokenCost}"
                                                                              ImageSource="/ForzaUI;component/Textures/Anthem/Icons/CRIcon/CR_128_Round.png"
                                                                              Width="60" Margin="0,10,5,10"
                                                                              HorizontalAlignment="Left" />
                                                            <local:FZTextBlock Style="{StaticResource A_Style_TextBlock_CarSelect_Cost}"
                                                                               Color="{StaticResource A_Color_CreditTokenCost}"
                                                                               Text="{Binding CurrentBonusCreditReward}"
                                                                               x:Name="CurrentBonusBonusCredits" Margin="0,18" />
                                                        </StackPanel>

                                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TotalPayment}"
                                                                           Text="{local:Loc PhotoCollection.IDS_NextCaptureBonus_Progress}"
                                                                           Margin="0,0,0,14"/>
                                                        <StackPanel Orientation="Horizontal">
                                                            <local:FZTextBlock x:Name="CurrentBonusProgressCurrentNum"
                                                                               Style="{StaticResource A_Style_FZTextBlock_CarsCollected_FirstNum}"
                                                                               Text="{Binding CurrentBonusProgressCurrentNum}"
                                                                               RenderTransformOrigin="0.5,0.5"
                                                                               Panel.ZIndex="1">
                                                                <local:FZTextBlock.RenderTransform>
                                                                    <TransformGroup>
                                                                        <ScaleTransform />
                                                                        <SkewTransform />
                                                                        <RotateTransform />
                                                                        <TranslateTransform />
                                                                    </TransformGroup>
                                                                </local:FZTextBlock.RenderTransform>
                                                            </local:FZTextBlock>
                                                            <local:FZTextBlock x:Name="CurrentBonusProgressOutOfSlash"
                                                                               Style="{StaticResource A_Style_FZTextBlock_CarsCollected}"
                                                                               Text="{local:Loc PhotoCollection.IDS_OutOf_Unformatted}" />
                                                            <local:FZTextBlock x:Name="CurrentBonusProgressOutOf"
                                                                               Style="{StaticResource A_Style_FZTextBlock_CarsCollected}"
                                                                               Text="{Binding CurrentBonusProgressOutOf}" />
                                                        </StackPanel>
                                                    </StackPanel>
                                                </Grid>
                                            </ContentControl>

                                            <ContentControl Style="{StaticResource A_Style_ContentControl_AnimatedTagSlideFromRight}"
                                                            x:Name="NextBonusPanel"
                                                            Margin="-10">
                                                <ContentControl.Tag>
                                                    <System:Double>1</System:Double>
                                                </ContentControl.Tag>
                                                <Grid Margin="10">
                                                    <StackPanel Orientation="Horizontal"
                                                                Margin="0, 23, 0, 0"
                                                                VerticalAlignment="Top">
                                                        <local:FZTextBlock x:Name="NextBonusMissionTextBefore"
                                                                           Style="{StaticResource A_Style_FZTextBlock_MissionText}"
                                                                           Text="{local:Loc PhotoCollection.IDS_BonusMissionBeforeText}" />
                                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_MissionText}"
                                                                           Color="{StaticResource A_Color_CreditTokenCost}"
                                                                           Text="{Binding NextBonusProgressOutOf}"
                                                                           Margin="5,0,5,0" />
                                                        <local:FZTextBlock x:Name="NextBonusMissionTextAfter"
                                                                           Style="{StaticResource A_Style_FZTextBlock_MissionText}"
                                                                           Text="{local:Loc PhotoCollection.IDS_BonusMissionAfterText}" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Vertical"
                                                                VerticalAlignment="Bottom">
                                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TotalPayment}"
                                                                           Text="{local:Loc PhotoCollection.IDS_NextCaptureBonus_Bonus}"
                                                                           Margin="0,0,0,16" />
                                                        <StackPanel Orientation="Horizontal"
                                                              Height="80"
                                                              Margin="0,0,0,39">
                                                            <local:FZMaterial Color="{StaticResource A_Color_CreditTokenCost}"
                                                                              ImageSource="/ForzaUI;component/Textures/Anthem/Icons/CRIcon/CR_128_Round.png"
                                                                              Width="60" Margin="0,10,5,10"
                                                                              HorizontalAlignment="Left" />
                                                            <local:FZTextBlock Style="{StaticResource A_Style_TextBlock_CarSelect_Cost}"
                                                                               Color="{StaticResource A_Color_CreditTokenCost}"
                                                                               Text="{Binding NextBonusCreditReward}"
                                                                               x:Name="NextBonusBonusCredits" />
                                                        </StackPanel>

                                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TotalPayment}"
                                                                           Text="{local:Loc PhotoCollection.IDS_NextCaptureBonus_Progress}"
                                                                           Margin="0,0,0,14" />
                                                        <StackPanel Orientation="Horizontal">
                                                            <local:FZTextBlock x:Name="NextBonusProgressCurrentNum"
                                                                               Style="{StaticResource A_Style_FZTextBlock_CarsCollected_FirstNum}"
                                                                               Text="{Binding NextBonusProgressCurrentNum}"
                                                                               RenderTransformOrigin="0.5,0.5"
                                                                               Panel.ZIndex="1">
                                                                <local:FZTextBlock.RenderTransform>
                                                                    <TransformGroup>
                                                                        <ScaleTransform />
                                                                        <SkewTransform />
                                                                        <RotateTransform />
                                                                        <TranslateTransform />
                                                                    </TransformGroup>
                                                                </local:FZTextBlock.RenderTransform>
                                                            </local:FZTextBlock>
                                                            <local:FZTextBlock x:Name="NextBonusProgressOutOfSlash"
                                                                               Style="{StaticResource A_Style_FZTextBlock_CarsCollected}"
                                                                               Text="{local:Loc PhotoCollection.IDS_OutOf_Unformatted}" />
                                                            <local:FZTextBlock x:Name="NextBonusProgressOutOf"
                                                                               Style="{StaticResource A_Style_FZTextBlock_CarsCollected}"
                                                                               Text="{Binding NextBonusProgressOutOf}" />
                                                        </StackPanel>
                                                    </StackPanel>
                                                </Grid>
                                            </ContentControl>
                                        </Grid>

                                    </DockPanel>
                                </StackPanel>
                            </Grid>

                        </Grid>
                    </StackPanel>
                </StackPanel>

                <StackPanel Orientation="Horizontal" x:Name="IEContent" VerticalAlignment="Bottom" HorizontalAlignment="Left" Visibility="Collapsed">
                    <ProgressBar IsIndeterminate="True"
                                 Style="{StaticResource A_Style_ProgressBar_WaitSpinner}" /> 
                    <local:FZTextBlock TextAlignment="Right"
                                       VerticalAlignment="Center"
                                       Text="{local:Loc PhotoCollection.IDS_ProcessingPhoto}"
                                       Style="{StaticResource A_Style_FZTextBlock_CategorySubHeaders}"
                                       FontSize="58"
                                       Margin="10,0,0,0" />
                </StackPanel>
            </Grid>
        </Border>
        <local:EventFire x:Name="EventFire" />
        <local:AudioEvent x:Name="ItemAppearAudioEvent" />
    </Grid>
</Page>
