<PhotoAnalysis 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>
        <Color x:Key="A_Color_Background">#1d1f20</Color>
        <Color x:Key="A_Color_WhiteLineDivider">#30F5F5F5</Color>

        <!-- Do not change the names of these Duration & EasingFunction resources; they are accessed directly from the scene. -->
        <Duration x:Key="PART_A_Duration_InitialDelay">0:0:1.0</Duration>
        <Duration x:Key="PART_A_Duration_NewCarListItem">0:0:0.32</Duration>
        <Duration x:Key="PART_A_Duration_NewRewardListItem">0:0:3.0</Duration>


        <UIStoryboard x:Key="H_Story_ShowCarListItem" FillBehavior="Stop">
            <UIStoryboard.TriggerAnimation>
                <AudioEventFireTrigger TriggerAnimation.KeyTime="0:0:0" AudioEvent="/Master/UI/Promo/HZ2_SFX_HUD_Promo_InfoScreenItemAppear_01" />
            </UIStoryboard.TriggerAnimation>
            <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="ClipToBounds"
                                           Storyboard.TargetName="root">
                <DiscreteBooleanKeyFrame KeyTime="0"
                                      Value="True" />
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.375"
                                      Value="False">
                </DiscreteBooleanKeyFrame>
            </BooleanAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)"
                                           Storyboard.TargetName="CarItemGrid">
                <EasingDoubleKeyFrame KeyTime="0"
                                      Value="-50" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.375"
                                      Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut" />
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                           Storyboard.TargetName="line">
                <EasingDoubleKeyFrame KeyTime="0"
                                      Value="0" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                      Value="0" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                      Value="1">
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </UIStoryboard>

        <MappingConverter x:Key="H_Converter_CurrencyControl">
            <MappingConverterEntry Key="{StaticResource H_Id_PhotoCategory}" Value="{StaticResource H_Style_Control_DJIcon}" />
            <MappingConverterEntry Key="{StaticResource H_Id_PromoCategory}" Value="{StaticResource H_Style_Control_FPIcon}" />
        </MappingConverter>

        <MappingConverter x:Key="H_Converter_RewardProgressString" Default="{Loc PhotoCollection.IDS_CompleteToUnlock}">
            <MappingConverterEntry Key="{StaticResource H_Id_PhotoCategory}" Value="{Loc PhotoCollection.IDS_MoreToUnlock}" />
            <MappingConverterEntry Key="{StaticResource H_Id_PromoCategory}" Value="{Loc PhotoCollection.IDS_MoreToUnlock}" />
        </MappingConverter>

        <DataTemplate x:Key="A_DataTemplate_PhotoAnalysisList_Item">
            <Grid x:Name="root" Height="80">
                <local:AudioEvent x:Name="ItemAppearAudioEvent" />

                <local:FZMaterial Color="{StaticResource A_Color_WhiteLineDivider}"
                                  Style="{StaticResource A_Style_FZMaterial_Panel_HorizontalDivider}"
                                  VerticalAlignment="Top"
                                  Visibility="{Binding (TickerItemsControlItem.Index), Converter={CompareConverter Value=0, Equal=Visible, NotEqual=Collapsed}}" />

                <DockPanel x:Name="CarItemGrid" Height="78" VerticalAlignment="Bottom">
                    <DockPanel.RenderTransform>
                        <TranslateTransform />
                    </DockPanel.RenderTransform>

                    <FZMaterial DockPanel.Dock="Left" 
                        Visibility="{Binding Info, Converter={FZBooleanToVisibilityConverter InvertResult=True}}"
                        Margin="14,0,0,0"
                        Width="46"
                        Height="46"
                        Preset="{RoundtangleStroke Thickness=3, CornerRadius=2}" Color="{StaticResource H_Color_Primary_White}">
                        <FZMaterial x:Name="tick" Height="28" Width="28" ImageSource="game:\Media\UI\Textures\Data_Bound\Promo\Tick_Icon.png" Color="{StaticResource H_Color_Primary_Green}"/>
                    </FZMaterial>

                    <UniformGrid Columns="1"
                        Margin="14,5">
                        <local:FZTextBlock x:Name="CarNameNormal"
                                           Text="{Binding Name}"
                                           Color="{StaticResource H_Color_Primary_White}"
                                           FontFamily="Horizon_B"
                                           VerticalAlignment="Center"
                                           CapHeight="18"/>
                        <StackPanel x:Name="currency_parts" Orientation="Horizontal"
                            Visibility="{Binding Currency, Converter={CompareConverter Value=0, Equal=Collapsed, NotEqual=Visible}}"
                            >
                            <local:FZTextBlock x:Name="Currency"
                                               Color="{StaticResource H_Color_Primary_White}"
                                               Text="{Binding Currency, Converter={NumUnitConverter FractionDigits=0}}"
                                               FontFamily="Horizon_C"
                                               VerticalAlignment="Center"
                                               CapHeight="18"/>
                            <Decorator Width="6"/>
                            <Control Height="22" Style="{Binding DataContext.CategoryId, RelativeSource={RelativeSource AncestorType=TickerItemsControl}, Converter={StaticResource H_Converter_CurrencyControl}}"/>
                        </Grid>
                    </UniformGrid>
                </DockPanel>

                <local:FZMaterial Color="{StaticResource A_Color_WhiteLineDivider}"
                                  Style="{StaticResource A_Style_FZMaterial_Panel_HorizontalDivider}"
                                  VerticalAlignment="Bottom"
                                  Margin="0,0,0,-2"
                                  x:Name="line" />
            </Grid>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding (TickerItemsControlItem.Reached)}"
                             Value="False">
                    <Setter Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Success}"
                             Value="{x:Static ChallengeObjectiveState.NotAttempted}">
                    <Setter TargetName="tick" Property="Visibility" Value="Hidden"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Success}"
                             Value="{x:Static ChallengeObjectiveState.Failed}">
                    <Setter TargetName="tick" Property="ImageSource" Value="game:\Media\UI\Textures\Data_Bound\Promo\Cross.png"/>
                    <Setter TargetName="tick" Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding (TickerItemsControlItem.Reached)}"
                             Value="True">
                    <DataTrigger.EnterActions>
                        <BeginUIStoryboard Storyboard="{StaticResource H_Story_ShowCarListItem}"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding DataContext.CategoryId, RelativeSource={RelativeSource AncestorType=TickerItemsControl}}"
                             Value="{Identifier64}">
                    <Setter TargetName="currency_parts" Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>

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

        <Style x:Key="H_Style_Control_Inline_CurrencyIcon" TargetType="Control">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <StackPanel Orientation="Horizontal">
                            <FZTextBlock Color="{Binding Color, RelativeSource={RelativeSource AncestorType=FZTextBlock, AncestorLevel=1}}" Stretch="UniformToFill" Text="{Binding (MultiDataConversion.Output), RelativeSource={RelativeSource Self}, Converter={NumUnitConverter FractionDigits=0}, RelativeSource={RelativeSource AncestorType=FZTextBlock, AncestorLevel=1}}"/>
                            <Decorator Width="5"/>
                            <Control Margin="0,-2" Style="{Binding DataContext.CategoryId, RelativeSource={RelativeSource AncestorType=TickerItemsControl}, Converter={StaticResource H_Converter_CurrencyControl}}"/>
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <MappingConverter x:Key="A_MarkupConverter_LevelProgress">
            <MappingConverterEntry Key="{NoCase BOLD}" Value="{StaticResource A_Style_FZRun_Markup_LevelProgress_BOLD}" />
            <MappingConverterEntry Key="{NoCase currency}" Value="{StaticResource H_Style_Control_Inline_CurrencyIcon}" />
        </MappingConverter>

        <Style x:Key="A_Style_FrameworkElement_RewardTitleContainer" 
               TargetType="{x:Type FrameworkElement}">
            <Setter Property="MaxWidth" Value="716"/>
            <Setter Property="Height" Value="72"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding HorizonPhotoChallenge.AreAllChallengesComplete}" Value="{StaticResource A_Boolean_True}">
                    <Setter Property="MaxWidth" Value="430"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="A_Style_FZTextBlock_PhotoChallenges_RewardTitle"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="CapHeight"
                    Value="25" />
            <Setter Property="HorizontalAlignment"
                    Value="Left" />
            <Setter Property="VerticalAlignment"
                    Value="Center" />
            <Setter Property="Stretch"
                    Value="None" />
            <Setter Property="AutoScroll"
                    Value="{StaticResource H_AutoScrollSettings_Horizontal_Title}" />
            <Setter Property="AutoScroll.AllowScrolling"
                    Value="True" />
            <Setter Property="Color"
                    Value="{StaticResource A_Color_SubHeader_Text}"/>
            <Setter Property="Text" Value="{local:Loc PhotoCollection.IDS_PhotoChallengeRewardInstruction}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding HorizonPhotoChallenge.AreAllChallengesComplete}" Value="{StaticResource A_Boolean_True}">
                    <Setter Property="Text" Value="{local:Loc PhotoCollection.IDS_RewardUnlocked}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <MultiConverter x:Key="H_Converter_Remaining">
            <MultiConverterEntry Converter="{MathOperationConverter Operation=Subtract}"/>
            <MultiConverterEntry Converter="{Clamp Min=0}"/>
        </MultiConverter>

        <Double x:Key="H_Double_List_Height">400</Double>

        <MultiConverter x:Key="H_Converter_List_Height">
            <MultiConverterEntry Converter="{Clamp Min={StaticResource H_Double_List_Height}}"/>
            <MultiConverterEntry Converter="{LinearTransformConverter Scale=-1, Add={StaticResource H_Double_List_Height}}"/>
        </MultiConverter>

        <Double x:Key="H_Double_Reward_Height">164</Double>

        <DataTemplate x:Key="A_DataTemplate_PhotoAnalysisLevelListItem">
            <StackPanel x:Name="translator">
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Panel_HorizontalDivider}"
                                      Color="{StaticResource A_Color_WhiteLineDivider}"/>
                <StackPanel
                        local:MultiDataConversion.TargetType="{x:Type Int32}"
                        local:MultiDataConversion.Value="{Binding ProgressCurrentNum}"
                        local:MultiDataConversion.Parameter="{Binding ProgressOutOf}"
                        local:MultiDataConversion.Converter="{StaticResource A_CompareConverter}"
                        x:Name="Container">

                    <Grid HorizontalAlignment="Center" 
                          Style="{StaticResource A_Style_FrameworkElement_RewardTitleContainer}">
                        <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                            <FZMaterial x:Name="gift" Width="48" Height="48" DockPanel.Dock="Left" ImageSource="game:\Media\UI\Textures\Data_Bound\Promo\Reward_Icon.png" Visibility="Collapsed" Margin="0,0,8,0" />
                            <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PhotoChallenges_RewardTitle}"
                                                   CapHeight="19"
                                                   MultiDataConversion.Value="{Binding ProgressOutOf}"
                                                   MultiDataConversion.Parameter="{Binding DataContext.Currency, RelativeSource={RelativeSource AncestorType=TickerItemsControl}}"
                                                   MultiDataConversion.TargetType="Int32"
                                                   MultiDataConversion.Converter="{StaticResource H_Converter_Remaining}"
                                                   PropertyChangeHistory.Input="{Binding (MultiDataConversion.Output), RelativeSource={RelativeSource Self}}"
                                                   Text="{Binding DataContext.CategoryId, RelativeSource={RelativeSource AncestorType=TickerItemsControl}, Converter={StaticResource H_Converter_RewardProgressString}}"
                                                   MarkupConverter="{StaticResource A_MarkupConverter_LevelProgress}"
                                                   FontFamily="Horizon_A_tf"
                                                   x:Name="remaining_count"
                                                   VerticalAlignment="Center" />
                                <FZMaterial x:Name="flash" Color="#ffff" Opacity="0" Preset="{Roundtangle Softness=30, CornerRadius=30}" Margin="-20" />
                            </Grid>
                        </DockPanel>
                    </Grid>

                    <Decorator 
                                  Visibility="{Binding Rewards, Converter={CompareConverter Value={x:Null}, Equal=Collapsed, NotEqual=Visible}}">
                        <ContentPresenter Content="{Binding Rewards}"
                                      ContentTemplate="{StaticResource A_DataTemplate_SmallReward}"
                                      HorizontalAlignment="Stretch" />
                                      </Decorator>
                </StackPanel>
            </StackPanel>
            <DataTemplate.Triggers>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding (PropertyChangeHistory.Current), ElementName=remaining_count, Converter={CompareConverter Value=0}}" Value="{x:Static CompareResult.Equal}"/>
                        <Condition Binding="{Binding (PropertyChangeHistory.Previous), ElementName=remaining_count, Converter={CompareConverter Value=0}}" Value="{x:Static CompareResult.GreaterThan}"/>
                    </MultiDataTrigger.Conditions>
                    <Setter TargetName="remaining_count" Property="Text" Value="{Loc PhotoCollection.IDS_RewardUnlocked}"/>
                    <Setter TargetName="gift" Property="Visibility" Value="Visible"/>
                    <DataTrigger.EnterActions>
                        <BeginUIStoryboard>
                            <BeginUIStoryboard.Storyboard>
                                <UIStoryboard>
                                    <UIStoryboard.TriggerAnimation>
                                        <AudioEventFireTrigger TriggerAnimation.KeyTime="0:0:0" AudioEvent="/Master/UI/Promo/SFX_HUD_Promo_InfoScreenRewardAppear" />
                                    </UIStoryboard.TriggerAnimation>
                                    <DoubleAnimation
                                        BeginTime="0:0:1.0"
                                        From="1"
                                        To="0"
                                        Duration="0:0:0.3"
                                        Storyboard.TargetName="translator"
                                        Storyboard.TargetProperty="Opacity"/>
                                    <DoubleAnimation
                                        From="0"
                                        To="1"
                                        Duration="0:0:0.1"
                                        Storyboard.TargetName="flash"
                                        Storyboard.TargetProperty="Opacity"/>
                                    <DoubleAnimation
                                        BeginTime="0:0:0.1"
                                        From="1"
                                        To="0"
                                        Duration="0:0:0.6"
                                        Storyboard.TargetName="flash"
                                        Storyboard.TargetProperty="Opacity"/>
                                </UIStoryboard>
                            </BeginUIStoryboard.Storyboard>
                        </BeginUIStoryboard>
                    </DataTrigger.EnterActions>
                </MultiDataTrigger>
                <DataTrigger Binding="{Binding (TickerItemsControlItem.IsFinalItem)}" Value="True">
                    <Setter TargetName="remaining_count" Property="Text" Value="{Loc PhotoCollection.IDS_AllRewardsUnlocked}"/>
                    <Setter TargetName="gift" Property="Visibility" Value="Visible"/>
                </DataTrigger>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding (TickerItemsControlItem.Reached)}" Value="False"/>
                        <Condition Binding="{Binding (TickerItemsControlItem.Index), Converter={CompareConverter Value=0}}" Value="{x:Static CompareResult.GreaterThan}"/>
                    </MultiDataTrigger.Conditions>
                    <Setter TargetName="translator" Property="Opacity" Value="0"/>
                </MultiDataTrigger>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding (TickerItemsControlItem.Reached)}" Value="True"/>
                        <Condition Binding="{Binding (TickerItemsControlItem.Index), Converter={CompareConverter Value=0}}" Value="{x:Static CompareResult.GreaterThan}"/>
                    </MultiDataTrigger.Conditions>
                    <MultiDataTrigger.EnterActions>
                        <BeginStoryboard>
                            <BeginStoryboard.Storyboard>
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames
                                        Storyboard.TargetName="translator"
                                        Storyboard.TargetProperty="Opacity">
                                        <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0" />
                                        <EasingDoubleKeyFrame KeyTime="0:0:1.6" Value="0" />
                                        <EasingDoubleKeyFrame KeyTime="0:0:1.9" Value="1" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </BeginStoryboard.Storyboard>
                        </BeginStoryboard>
                    </MultiDataTrigger.EnterActions>
                </MultiDataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>

        <Storyboard x:Key="PART_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="PART_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="ButtonBarAnimHelper">
                <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>

        <Storyboard x:Key="H_Storyboard_BlendScroll">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(BlendValue.Blend)">
                <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.375" Value="1" EasingFunction="{CubicEase EasingMode=EaseOut}"/>
            </Int32AnimationUsingKeyFrames>
        </Storyboard>

        <Style TargetType="FZRun"
            x:Key="H_Markup_Totals_Title">
            <Setter Property="FontFamily" Value="Horizon_A" />
        </Style>

        <Style TargetType="FZRun"
            x:Key="H_Markup_Totals_Progress">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_Green}" />
        </Style>

        <MappingConverter x:Key="H_MarkupConverter_Totals">
            <MappingConverterEntry Key="{NoCase Title}" Value="{StaticResource H_Markup_Totals_Title}" />
            <MappingConverterEntry Key="{NoCase Progress}" Value="{StaticResource H_Markup_Totals_Progress}" />
        </MappingConverter>

        <MappingConverter x:Key="H_Converter_BannerImage">
            <MappingConverterEntry Key="{StaticResource H_Id_PhotoCategory}" Value="game:\Media\UI\Textures\Data_Bound\Promo\DJ_Banner.png" />
            <MappingConverterEntry Key="{StaticResource H_Id_PromoCategory}" Value="game:\Media\UI\Textures\Data_Bound\Promo\HF_Banner.png" />
        </MappingConverter>

        <MappingConverter x:Key="H_Converter_ProgressFormat" Default="{Loc PhotoCollection.IDS_PhotoChallengeActiveFormat}">
            <MappingConverterEntry Key="{StaticResource H_Id_PhotoCategory}" Value="{Loc PhotoCollection.IDS_PhotoProgress}" />
            <MappingConverterEntry Key="{StaticResource H_Id_PromoCategory}" Value="{Loc PhotoCollection.IDS_PromoProgress}" />
        </MappingConverter>

        <DataTemplate x:Key="H_Template_ItemsList">
            <StackPanel DockPanel.Dock="Left" 
                        Margin="30,0"
                        Width="540">
                        <FZMaterial x:Name="banner" Height="76" ImageSource="{Binding CategoryId, Converter={StaticResource H_Converter_BannerImage}}"/>

                <Decorator Height="20" />


                <FZTextBlock x:Name="promo_title"
                        Color="{StaticResource H_Color_Primary_White}"
                        CapHeight="22"
                        Margin="14,0"
                        FontFamily="Horizon_B_tf"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Left"
                        MultiStringFormatter.Format="{Binding CategoryId, Converter={StaticResource H_Converter_ProgressFormat}, FallbackValue={Loc PhotoCollection.IDS_PhotoChallengeActiveFormat}}"
                        MultiStringFormatter.Param0="{Binding Progress}"
                        MultiStringFormatter.Param1="{Binding Total}"
                        MultiStringFormatter.Param2="{Binding Title}"
                        MarkupConverter="{StaticResource H_MarkupConverter_Totals}"
                        Text="{Binding (MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"/>

                <Decorator Height="22" />

                <Grid Height="{StaticResource H_Double_List_Height}" ClipToBounds="True">
                    <StackPanel>
                        <TickerItemsControl 
                            x:Name="items_control"
                            ItemTemplate="{StaticResource A_DataTemplate_PhotoAnalysisList_Item}"
                            ItemsSource="{Binding Items}"
                            BlendValue.Input="{Binding ActualHeight, RelativeSource={RelativeSource Self}, Converter={StaticResource H_Converter_List_Height}}"
                            BlendValue.InputChangedStoryboard="{StaticResource H_Storyboard_BlendScroll}" 
                            Value="{Binding CurrentItemIndex}">
                            <ItemsControl.Template>
                                <ControlTemplate TargetType="TickerItemsControl">
                                    <StackPanel IsItemsHost="True"/>
                                </ControlTemplate>
                            </ItemsControl.Template>
                            <TickerItemsControl.RenderTransform>
                                <TranslateTransform Y="{Binding (BlendValue.Output), ElementName=items_control}"/>
                            </TickerItemsControl.RenderTransform>
                        </TickerItemsControl>
                    </StackPanel>
                </Grid>

                <Grid Height="{StaticResource H_Double_Reward_Height}" ClipToBounds="True">
                    <StackPanel >
                        <TickerItemsControl 
                            x:Name="rewards_control"
                            ItemTemplate="{StaticResource A_DataTemplate_PhotoAnalysisLevelListItem}"
                            ItemsSource="{Binding LevelItems}"
                            Value="{Binding CurrentLevelItemIndex}">
                            <ItemsControl.Template>
                                <ControlTemplate TargetType="TickerItemsControl">
                                    <Grid IsItemsHost="True"/>
                                </ControlTemplate>
                            </ItemsControl.Template>
                        </TickerItemsControl>
                    </StackPanel>
                </Grid>
            </StackPanel>
            <DataTemplate.Triggers>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding CategoryId}" Value="{Identifier64}"/>
                        <Condition Binding="{Binding IsStoryCapture, RelativeSource={RelativeSource AncestorType=Page}}" Value="False"/>
                    </MultiDataTrigger.Conditions>
                    <Setter TargetName="banner" Property="ImageSource" Value="game:\Media\UI\Textures\Data_Bound\Promo\FP_Banner.png"/>
                </MultiDataTrigger>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding CategoryId}" Value="{Identifier64}"/>
                        <Condition Binding="{Binding IsStoryCapture, RelativeSource={RelativeSource AncestorType=Page}}" Value="True"/>
                    </MultiDataTrigger.Conditions>
                    <Setter TargetName="banner" Property="ImageSource" Value="game:\Media\UI\Textures\Data_Bound\Promo\DJ_Banner.png"/>
                </MultiDataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
    </Page.Resources>

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

        <local:MappingConverterResourcePreloader Converter="{StaticResource H_Converter_RewardTypeToIcon}" ValueType="BitmapImage" />

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

        <local:FZMaterialGlassCapture />

        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <Grid Margin="{StaticResource A_Thickness_ScenePadding}">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Decorator>
                        <ContentPresenter ContentTemplate="{StaticResource H_Template_ItemsList}" Content="{Binding Lists[1]}"/>
                    </Decorator>
                    <Decorator Visibility="{Binding IsPromoEnabled, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                        <ContentPresenter ContentTemplate="{StaticResource H_Template_ItemsList}" Content="{Binding Lists[0]}"/>
                    </Decorator>
                    <Decorator>
                        <ContentPresenter ContentTemplate="{StaticResource H_Template_ItemsList}" Content="{Binding Lists[2]}"
                            Visibility="{Binding Items.Count, Converter={CompareConverter 0, Equal=Collapsed, NotEqual=Visible}, FallbackValue=Collapsed}"/>
                    </Decorator>
                </DockPanel>
                <StackPanel x:Name="ProcessingPhotoText"
                            Orientation="Horizontal"
                            VerticalAlignment="Bottom"
                            HorizontalAlignment="Left"
                            Opacity="1"
                            Margin="-2,0,0,-18">
                    <ProgressBar IsIndeterminate="True"
                                 Style="{StaticResource A_Style_ProgressBar_WaitSpinner}"
                                 Height="34" />
                    <Decorator Width="10" />
                    <local:FZTextBlock Text="{local:Loc PhotoCollection.IDS_ProcessingPhoto}"
                                       VerticalAlignment="Bottom"
                                       Margin="0,0,0,2"
                                       Style="{StaticResource A_Style_FZTextBlock_Heading_Small}"
                                       FontFamily="Horizon_B"
                                       Color="{StaticResource A_Color_White}"
                                       CapHeight="20" />
                </StackPanel>
            </Grid>
        </Grid>
        <local:EventFire x:Name="EventFire" />
        <local:AudioEvent x:Name="LevelItemChangeover" />

        <Decorator x:Name="ButtonBarAnimHelper"
                   Opacity="0">
            <ContentControl x:Name="BottomBar"
                            Style="{StaticResource A_Style_ButtonBar}">
                <ControllerButtonPanel x:Name="PART_HelpPanel"
                                       Style="{StaticResource A_Style_ControllerButtonPanel_Default}" >
                    <local:ControllerButtonControl Button="A"  Description="{local:Loc HelpButtons.IDS_Continue}"/>
                    <local:ControllerButtonControl Button="B" />
                    <local:ControllerButtonControl Button="Y"
                                                   Visibility="{Binding Description, RelativeSource={RelativeSource Self}, Converter={StaticResource A_StringVisConverter}, FallbackValue=Collapsed}" />
                </ControllerButtonPanel>
            </ContentControl>
        </Decorator>
    </Grid>
</PhotoAnalysis>
