<Page xmlns:local="clr-namespace:ForzaUI"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      x:Class="ForzaUI.A_CampaignSlotMenu"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Margin="0">
    <Page.Resources>
        <ResourceDictionary>
            <Double x:Key="A_SlotMenu_Panel_Width">512</Double>
            <Double x:Key="A_SlotMenu_Panel_Height">708</Double>
            <Double x:Key="A_SlotMenu_Panel_Height_With_Tile">762</Double>
            <Double x:Key="A_RaceInfo_Panel_Height_Without_Tabs">398</Double>
            <Double x:Key="A_RaceInfo_Panel_Height_With_Tabs">340</Double>

            <Color x:Key="A_Color_Job_Yellow_Highlight">#F8EB02</Color>
            <Color x:Key="A_Color_WhiteLineDivider">#30F5F5F5</Color>

            <Style x:Key="A_Style_FZRun_Description_Yellow" TargetType="local:FZRun">
                <Setter Property="Color" Value="{StaticResource A_Color_Job_Yellow_Highlight}" />
            </Style>

            <MappingConverter x:Key="A_MappingConverter_Yellow_Title">
                <MappingConverterEntry Key="{NoCase YELLOW}" Value="{StaticResource A_Style_FZRun_Description_Yellow}"/>
            </MappingConverter>

            <Storyboard x:Key="A_Storyboard_Description_Collapsed">
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DescriptionPanel">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>
            
            <Storyboard x:Key="A_Storyboard_OnlineSeasonalChampionship_Mode">
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SlotMenu">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DescriptionPanel">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="OnlineSeasonalEventDescription">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="OnlineSeasonalMenu">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>

            <Storyboard x:Key="A_Storyboard_OnlineSeasonalChampionship_Games_Mode">
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SlotMenu">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DescriptionPanel">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="OnlineSeasonalEventDescription">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="OnlineSeasonalMenu">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>

            <!--This is used to return a local string based on the binding value-->
            <local:MappingConverter x:Key="A_Converter_CampaignSwitchEventToSwitchEventString" CheckEnumKey="CampaignSwitchEventAVUI">
                <local:MappingConverterEntry Key="{x:Static local:CampaignSwitchEventAVUI.NotAvailable}" Value="{x:Null}"/>
                <local:MappingConverterEntry Key="{x:Static local:CampaignSwitchEventAVUI.Normal}" Value="{local:Loc HelpButtons.IDS_SwitchToNormalEvent}"/>
                <local:MappingConverterEntry Key="{x:Static local:CampaignSwitchEventAVUI.Season}" Value="{local:Loc HelpButtons.IDS_SwitchToSeasonEvent}"/>
            </local:MappingConverter>

            <Color x:Key="A_Color_GreyPanel">#FFF2F2F2</Color>

            <Style x:Key="A_Style_StarIcon" TargetType="local:FZMaterial">
                <Setter Property="Width" Value="68"/>
                <Setter Property="Height" Value="68"/>
                <Setter Property="Stretch" Value="Uniform"/>
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/CampaignSlot_GreyStar.png"/>
            </Style>

            <Style x:Key="A_Style_ListBoxItem_CampaignSlotMenu" TargetType="ContentControl" BasedOn="{StaticResource H_Style_ContentControl_Carousel_ContainerStyle}">
                <Style.Resources>
                    <CornerRadius x:Key="A_StrokeHighlight_ContentRadius">2</CornerRadius>
                </Style.Resources>
                <Setter Property="DynamicData.Data">
                    <Setter.Value>
                        <DynamicDataSource>
                            <DynamicDataItem Name="ScaledContainerStyle"
                                             DataType="Style">
                                <DynamicDataItem.Value>
                                    <Style TargetType="FrameworkElement">
                                        <Setter
                                            Property="RenderTransform">
                                            <Setter.Value>
                                                <ScaleTransform />
                                            </Setter.Value>
                                        </Setter>
                                        <Style.Triggers>
                                            <DataTrigger
                                                Binding="{Binding (Selector.IsSelected), RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                                                Value="True">
                                                <DataTrigger.EnterActions>
                                                    <BeginStoryboard
                                                        HandoffBehavior="SnapshotAndReplace">
                                                        <Storyboard>
                                                            <DoubleAnimationUsingKeyFrames
                                                                Storyboard.TargetProperty="(FrameworkElement.RenderTransform).(ScaleTransform.ScaleX)">
                                                                <DiscreteDoubleKeyFrame
                                                                    KeyTime="0:0:0.0"
                                                                    Value="1.025" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                            <DoubleAnimationUsingKeyFrames
                                                                Storyboard.TargetProperty="(FrameworkElement.RenderTransform).(ScaleTransform.ScaleY)">
                                                                <DiscreteDoubleKeyFrame
                                                                    KeyTime="0:0:0.0"
                                                                    Value="1.025" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.EnterActions>
                                                <DataTrigger.ExitActions>
                                                    <BeginStoryboard
                                                        HandoffBehavior="SnapshotAndReplace">
                                                        <Storyboard>
                                                            <DoubleAnimationUsingKeyFrames
                                                                Storyboard.TargetProperty="(FrameworkElement.RenderTransform).(ScaleTransform.ScaleX)">
                                                                <EasingDoubleKeyFrame
                                                                    KeyTime="0:0:0.3"
                                                                    Value="1.0"
                                                                    EasingFunction="{CircleEasing}" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                            <DoubleAnimationUsingKeyFrames
                                                                Storyboard.TargetProperty="(FrameworkElement.RenderTransform).(ScaleTransform.ScaleY)">
                                                                <EasingDoubleKeyFrame
                                                                    KeyTime="0:0:0.3"
                                                                    Value="1.0"
                                                                    EasingFunction="{CircleEasing}" />
                                                            </DoubleAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.ExitActions>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </DynamicDataItem.Value>
                            </DynamicDataItem>
                            <DynamicDataItem Name="DropShadowStyle"
                                             DataType="Style">
                                <DynamicDataItem.Value>
                                    <Style BasedOn="{StaticResource H_Style_FZMaterial_ShadowBase_ForSubgraph}"
                                           TargetType="{Type FZMaterial}">
                                        <Setter Property="Preset">
                                            <Setter.Value>
                                                <FZMaterialPresetRoundtangle
                                                    Softness="20"
                                                    CornerRadius="20"
                                                    AlphaMode="MultiplyInvColorOnly"
                                                    Unlit="True" />
                                            </Setter.Value>
                                        </Setter>
                                        <Setter Property="Margin"
                                            Value="24,24,-24,-24" />
                                    </Style>
                                </DynamicDataItem.Value>
                            </DynamicDataItem>
                            <DynamicDataItem Name="ItemBackgroundStyle"
                                             DataType="Style">
                                <DynamicDataItem.Value>
                                    <Style TargetType="{Type FZMaterial}">
                                        <Setter Property="Height" Value="50"/>
                                        <Setter Property="Width" Value="512"/>
                                    </Style>
                                </DynamicDataItem.Value>
                            </DynamicDataItem>
                        </DynamicDataSource>
                    </Setter.Value>
                </Setter>
                <Setter Property="Height" Value="50"/>
                <Setter Property="Width" Value="512"/>
                <Setter Property="Margin" Value="0,0,0,4"/>
            </Style>

            <MappingConverter x:Key="A_LangStrToComingSoonBannerTextWrapping" Default="Wrap">
                <MappingConverterEntry Key="CHS" Value="NoWrap"/>
                <MappingConverterEntry Key="CHT" Value="NoWrap"/>
                <MappingConverterEntry Key="JP" Value="NoWrap"/>
                <MappingConverterEntry Key="HU" Value="NoWrap"/>
            </MappingConverter>

            <Style x:Key="A_Style_FZTextBlock_ComingSoonBanner" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="Text" Value="{local:Loc TiledMenus.IDS_ComingSoonBanner}"/>
                <Setter Property="TextWrapping" Value="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_LangStrToComingSoonBannerTextWrapping}}"/>
                <Setter Property="TextAlignment" Value="Center"/>
                <Setter Property="LineAdjust" Value="-0.4"/>
                <Setter Property="Color" Value="#FFF"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="Margin" Value="0,0"/>
                <Setter Property="CapHeight" Value="14"/>
            </Style>

            <!--Item Template for slotmenu-->
            <DataTemplate x:Key="A_DataTemplate_ListItem_CampaignSlotMenuItem">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}" >
                    <local:FZMaterial x:Name="DropShadow" Opacity="0.6" Visibility="Hidden" Margin="-25,-15"
                                      Style="{StaticResource A_Style_FZMaterial_ShadowBase_ForSubgraph}">
                    </local:FZMaterial>
                    <Grid Margin="6,6,6,56" x:Name="StarPanel" Visibility="Hidden" >
                        <local:FZMaterial Color="{StaticResource A_Color_GreyPanel}" Width="Auto"
                                          Height="Auto" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}">
                            <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                <local:FZMaterial x:Name="Star1" Style="{StaticResource A_Style_StarIcon}" Margin="0,0,113,0"/>
                                <local:FZMaterial x:Name="Star2" Style="{StaticResource A_Style_StarIcon}" HorizontalAlignment="Center"/>
                                <local:FZMaterial x:Name="Star3" Style="{StaticResource A_Style_StarIcon}" Margin="113,0,0,0"/>
                            </Grid>
                        </local:FZMaterial>
                    </Grid>
                        <local:FZTextBlock x:Name="SlotText"
                                           Text="{Binding Heading}"
                                           Style="{StaticResource A_Style_FZTextBlock_OptionText_Heading}"
                                           local:ScreenReader.Event="OnChange"
                                           local:ScreenReader.ControlType="Button"
                                           local:ScreenReader.LineType="SelectedItem"
                                           local:ScreenReader.SelectedNumber="{Binding (VirtualizingWrapPanel.ItemIndex), RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"
                                           local:ScreenReader.SelectedCount="{Binding Items.Count, RelativeSource={RelativeSource AncestorType={x:Type Selector}}}"/>
                    <local:FZMaterial x:Name="PadLock" Width="auto" Stretch="UniformToFill" Height="34" Visibility="Collapsed"
                                      ImageSource="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/Locked.png"
                                      HorizontalAlignment="Right"
                                      Opacity="0.6"
                                      VerticalAlignment="Center"
                                      Color="{StaticResource H_Color_Primary_White}"
                                      local:ScreenReader.Event="OnChange"
                                      local:ScreenReader.ControlType="None"
                                      local:ScreenReader.LineType="SelectedValue"/>
                    <local:FZMaterial x:Name="ComingSoonBanner" 
                                      Visibility="Collapsed" 
                                      Color="{StaticResource A_Color_Tile_Background_Alternate}"
                                      Width="104" Height="104"
                                      VerticalAlignment="Top" HorizontalAlignment="Right">
                        <local:FZMaterial.Data>
                            <local:FZGeometry Data="M0,0 56,0 104,48 104,104 Z" />
                        </local:FZMaterial.Data>
                        <Decorator Width="73" Height="31" RenderTransformOrigin="0.5,0.5">
                            <Decorator.RenderTransform>
                                <RotateTransform Angle="45" />
                            </Decorator.RenderTransform>
                            <Decorator Margin="0,-19,0,19">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_ComingSoonBanner}" />
                            </Decorator>
                        </Decorator>
                    </local:FZMaterial>
                    <StrokeHighlightControl Style="{StaticResource A_Style_ContentControl_TileSelectionStroke}" Focusable="False"/>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
                        <Setter TargetName="SlotText" Property="local:ScreenReader.Line" Value="{Binding Text, ElementName=SlotText}" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True"/>
                            <Condition Binding="{Binding OnSelectCommand.DeniedCommand, Converter={StaticResource A_Converter_DeniedCommandToLockState}}" Value="{x:Static local:LockState.Locked}"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="PadLock" Property="local:ScreenReader.Line" Value="{local:Loc Main.IDS_ItemLocked_ScreenReader}"/>
                    </MultiDataTrigger>
                    <!--Stars above 0 (returns value 1), result in enabling star display instead of icon-->
                    <DataTrigger Binding="{Binding StarCount, Converter={StaticResource A_CompareConverter}, ConverterParameter=0}" Value="1">
                        <Setter TargetName="StarPanel" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding StarCount}" Value="3">
                        <Setter TargetName="SlotText" Property="Color" Value="#7F000000"/>
                    </DataTrigger>

                    <!--Lock state trigger.-->
                    <DataTrigger Binding="{Binding OnSelectCommand.DeniedCommand, Converter={StaticResource A_Converter_DeniedCommandToLockState}}" Value="{x:Static local:LockState.Locked}">
                        <Setter TargetName="PadLock" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="SlotText" Property="Opacity" Value="0.6"/>
                        <Setter TargetName="SlotText" Property="Color" Value="{StaticResource A_Color_White}"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding LockState}" Value="{x:Static local:LockState.Locked}">
                        <Setter TargetName="PadLock" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="SlotText" Property="Opacity" Value="0.6"/>
                        <Setter TargetName="SlotText" Property="Color" Value="{StaticResource A_Color_White}"/>
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding OnSelectCommand.DeniedCommand, Converter={StaticResource A_Converter_DeniedCommandToLockState}}" Value="{x:Static local:LockState.Locked}"/>
                            <Condition Binding="{Binding IsComingSoon}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="PadLock" Property="Visibility" Value="Visible"/>
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsComingSoon}" Value="True">
                        <Setter TargetName="ComingSoonBanner" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsKeyboardFocused}" Value="True">
                        <Setter TargetName="DropShadow" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <!--Use compare converter to check that starcount has value above 0 (value of 1,2 or 3)-->
                    <DataTrigger Binding="{Binding StarCount, Converter={StaticResource A_CompareConverter}, ConverterParameter=0}" Value="1">
                        <Setter TargetName="Star1" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/CampaignSlot_Star.png"/>
                    </DataTrigger>
                    <!--Use compare converter to check that starcount has value above 1 (value of 2 or 3)-->
                    <DataTrigger Binding="{Binding StarCount, Converter={StaticResource A_CompareConverter}, ConverterParameter=1}" Value="1">
                        <Setter TargetName="Star2" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/CampaignSlot_Star.png"/>
                    </DataTrigger>
                    <!--Last check only against value of 3-->
                    <DataTrigger Binding="{Binding StarCount}" Value="3">
                        <Setter TargetName="Star3" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/CampaignSlot_Star.png"/>
                    </DataTrigger>
                </DataTemplate.Triggers>

            </DataTemplate>
 
            <System:Double x:Key="A_Double_SlotMenu_WrapPanel_ItemsPerRow">1</System:Double>
            <local:LinearTransformConverter x:Key="A_LinearTransformConverter_SlotMenu_RowsToHeight"
                                            Scale="54" />

            <Style x:Key="A_Style_CampaignSlotMenu_ListBoxItem"
                   BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_Gaps}"
                           TargetType="ListBoxItem">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding OnSelectCommand.DeniedCommand, Converter={StaticResource A_Converter_DeniedCommandToLockState}}" Value="{x:Static local:LockState.Locked}">
                        <Setter Property="Tag" Value="Inactive"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding LockState}" Value="{x:Static local:LockState.Locked}">
                        <Setter Property="Tag" Value="Inactive"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            
            <!--ListBox Template for slotmenu-->
            <Style x:Key="A_Style_ListBox_CampaignSlotMenu"
                             TargetType="local:WrapListBox">
   
            </Style>

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

            <MappingConverter x:Key="A_MappingConverter_Bold_Description">
                <MappingConverterEntry Key="{NoCase BOLD}" Value="{StaticResource A_Style_FZRun_Description_Bold}"/>
            </MappingConverter>

            <Style x:Key="A_Style_FZTextBlock_SeasonalText" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
                <Setter Property="Color" Value="{StaticResource A_Color_White}"/>
                <Setter Property="Margin" Value="6,0"/>
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_SeasonalRewardText" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="Color" Value="{StaticResource A_Color_White}"/>
                <Setter Property="Margin" Value="6,0"/>
                <Setter Property="FontSize" Value="26"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
            </Style>
            
            <Style x:Key="A_Style_FZRun_StarCondition_NUM" TargetType="{x:Type local:FZRun}">
                <Setter Property="FontFamily" Value="Horizon_A" />
            </Style>

            <MappingConverter x:Key="A_MappingConverter_StartCondition">
                <MappingConverterEntry Key="{NoCase NUM}" Value="{StaticResource A_Style_FZRun_StarCondition_NUM}"/>
            </MappingConverter>

            <Style x:Key="A_Style_FZMaterial_HeaderStarIcon" TargetType="local:FZMaterial">
                <Setter Property="Width" Value="32"/>
                <Setter Property="Height" Value="32"/>
                <Setter Property="Margin" Value="5"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_HeaderInactiveStar" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_HeaderStarIcon}">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/Star_Icon_White.png"/>
            </Style>
            
            <Style x:Key="A_Style_FZMaterial_HeaderActiveStar" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_HeaderStarIcon}">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/Star_Icon.png"/>
            </Style>

            <Style x:Key="A_Style_SlotMenu_TabBar" BasedOn="{StaticResource H_Style_TabBar_SquareIcons}" TargetType="ItemsSelector">
                <Setter Property="Height" Value="48" />
                <Setter Property="Margin" Value="0,0,0,4" />
                <Setter Property="DynamicData.Data">
                    <Setter.Value>
                        <DynamicDataSource>
                            <DynamicDataItem
                                Name="TabHeight"
                                DataType="Double"
                                Value="48" />
                            <DynamicDataItem
                                Name="NextOrPreviousWidth"
                                DataType="Double"
                                Value="66" />
                            <DynamicDataItem
                                Name="NextOrPreviousHeight"
                                DataType="Double"
                                Value="48" />
                            <DynamicDataItem
                                Name="ButtonWidth"
                                DataType="Double"
                                Value="140" />
                            <DynamicDataItem
                                Name="IconWidth"
                                DataType="Double"
                                Value="30" /> 
                        </DynamicDataSource>
                    </Setter.Value>
                </Setter>
            </Style>
            <!--Control for a star used in the header-->
            <ControlTemplate x:Key="A_ControlTemplate_StarHeader">
                <Grid>
                    <local:FZMaterial x:Name="StarImageOff" Style="{StaticResource A_Style_FZMaterial_HeaderInactiveStar}"/>
                    <local:FZMaterial x:Name="StarImageOn" Visibility="Collapsed"
                                      Style="{StaticResource A_Style_FZMaterial_HeaderActiveStar}"/>
                </Grid>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="True">
                        <Setter TargetName="StarImageOn" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="StarImageOff" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            
            <Style x:Key="A_Style_StarHeader" TargetType="{x:Type Control}" >
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_StarHeader}"/>
                <Setter Property="Tag" Value="0"/>
            </Style>

            <!--Slightly Different Control for the star bar used in the header-->
            <ControlTemplate x:Key="A_ControlTemplate_StarDisplay_Header" >
                <StackPanel x:Name="StarContainerHeader" Orientation="Horizontal" HorizontalAlignment="Center">
                    <Control x:Name="Star1" Style="{StaticResource A_Style_StarHeader}" Visibility="Collapsed" Tag="False"/>
                    <Control x:Name="Star2" Style="{StaticResource A_Style_StarHeader}" Visibility="Collapsed" Tag="False"/>
                    <Control x:Name="Star3" Style="{StaticResource A_Style_StarHeader}" Visibility="Collapsed" Tag="False"/>
                </StackPanel>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Value="1">
                        <Setter TargetName="Star1" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="Star3" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Value="2">
                        <Setter TargetName="Star1" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star3" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Value="3">
                        <Setter TargetName="Star1" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star3" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource Self}}" Value="True">
                        <Setter TargetName="Star1" Property="Tag" Value="True"/>
                        <Setter TargetName="Star2" Property="Tag" Value="True"/>
                        <Setter TargetName="Star3" Property="Tag" Value="True"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <Style x:Key="A_Style_ControlTemplate_StarDisplay_Header" TargetType="{x:Type Control}">
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_StarDisplay_Header}"/>

            </Style>

            <ControlTemplate x:Key="A_ControlTemplate_StarConditions">
                <StackPanel Orientation="Vertical" Width="auto">
                    <local:FZMaterial Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"
                                      Margin="0">
                        <StackPanel Orientation="Vertical">
                            <Control Height="65"
                                     x:Name="StarHeaderDisplay"
                                     Style="{StaticResource A_Style_ControlTemplate_StarDisplay_Header}"
                                     Tag="{Binding Tag}"
                                     BindingProxy.A="False"/>
                            <Grid Height="48">
                                <Grid x:Name="MedalPanelIncomplete">
                                    <local:FZMaterial Color="{StaticResource H_Color_Primary_Black}"
                                                      Opacity="0.15"/>
                                    <local:FZTextBlock x:Name="IncompleteTextName"
                                                       Style="{StaticResource A_Style_FZTextBlock_HorizonB}"
                                                       HorizontalAlignment="Center"
                                                       VerticalAlignment="Center"
                                                       Margin="20,10" CapHeight="18"
                                                       Color="{StaticResource H_Color_Primary_Grey_70pc}"
                                                       Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                                       MarkupConverter="{StaticResource A_MappingConverter_StartCondition}" />
                                </Grid>
                                <Grid x:Name="MedalPanelAchieved" Visibility="Collapsed">
                                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Anthem/HorizonStories/GoldPanel.png"
                                                      Width="auto" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll1px}"/>
                                    <local:FZTextBlock x:Name="HighlightedTextName"
                                                       Style="{StaticResource A_Style_FZTextBlock_HorizonB}"
                                                       HorizontalAlignment="Center"
                                                       VerticalAlignment="Center"
                                                       Margin="20,10" CapHeight="18"
                                                       Color="{StaticResource H_Color_Primary_Black}"
                                                       Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                                       MarkupConverter="{StaticResource A_MappingConverter_StartCondition}" />
                                </Grid>
                            </Grid>
                        </StackPanel>
                    </local:FZMaterial>
                </StackPanel>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding (BindingProxy.A), RelativeSource={RelativeSource Self}}" Value="True">
                        <Setter TargetName="StarHeaderDisplay" Property="local:BindingProxy.A" Value="True"/>
                        <Setter TargetName="MedalPanelIncomplete" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="MedalPanelAchieved" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <Style x:Key="A_Style_StarConditions" TargetType="{Type ContentControl}">
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_StarConditions}"/>
                <Setter Property="Margin" Value="5,0"/>
                <Setter Property="Width" Value="150"/>
            </Style>
            
            <Style x:Key="A_FZMaterial_Info_Panel_Background" TargetType="FZMaterial"
                BasedOn="{StaticResource H_Style_Container_GlassHighBlur_Description}">
                <Setter Property="Height" Value="{StaticResource A_RaceInfo_Panel_Height_Without_Tabs}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Tabs.Count, Converter={StaticResource A_CompareConverter}, ConverterParameter=1}" 
                                 Value="{x:Static local:CompareResult.GreaterThan}">
                        <Setter Property="Height" Value="{StaticResource A_RaceInfo_Panel_Height_With_Tabs}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ProgressBar_Jobs" TargetType="{x:Type ProgressBar}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ProgressBar}">
                            <DockPanel x:Name="PART_Track">
                                <Grid x:Name="PART_Indicator" HorizontalAlignment="Left" ClipToBounds="True">
                                    <FZMaterial Width="{Binding ActualWidth, ElementName=PART_Track}" 
                                       Preset="{Roundtangle CornerRadius=7}" 
                                       Height="17" 
                                       Color="{StaticResource H_Color_Primary_Green}"/>
                                </Grid>
                            </DockPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <DataTemplate DataType="{x:Type CampaignSlotMenuItem}">
                <Grid x:Name="RaceInfoRoot">
                    <Control Style="{StaticResource A_Style_Event_RaceInfoPanel_PreRace}" 
                             Margin="0,0,0,2"
                             Width="512"
                             VerticalAlignment="Stretch"
                             DataContext="{Binding EventInfoDataView, RelativeSource={RelativeSource AncestorType=Page}}"/>
                </Grid>
            </DataTemplate>

            <DataTemplate DataType="{x:Type SeasonalCampaignSlotMenuItem}">
                <DataTemplate.Resources>
                    <MappingConverter x:Key="A_TabType_Is_Reward" Default="Collapsed">
                        <MappingConverterEntry Key="{x:Static CampaignSlotTabType.Reward}" Value="Visible"/>
                    </MappingConverter>

                    <MappingConverter x:Key="A_TabType_Is_Track" Default="Collapsed">
                        <MappingConverterEntry Key="{x:Static CampaignSlotTabType.Track}" Value="Visible"/>
                    </MappingConverter>

                    <Style x:Key="A_FrameworkElement_RewardIcon_Size" TargetType="FrameworkElement">
                        <Setter Property="Height" Value="200"/>
                        <Setter Property="Width" Value="200"/>
                        <Setter Property="VerticalAlignment" Value="Center"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RewardType}" Value="{x:Static UIRewardType.Car}">
                                <Setter Property="Width" Value="400" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </DataTemplate.Resources>
                <Grid>
                    <Grid Visibility="{Binding SelectedTab.TabType, RelativeSource={RelativeSource AncestorType=Page}, 
                                        Converter={StaticResource A_TabType_Is_Reward}, FallbackValue=Collapsed}">
                        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/Reward_Backgroud.png">
                            <StackPanel DataContext="{Binding SlotEventObjectives[0]}">
                                <!-- 
                                Forte bug 4363377 requires a last minute removal of a textblock that was here, but that changed the layout of the reward cars slightly
                                the 53 pixel decorator now exists so the layout will remain unaffected, and just the text block can be gone
                                -->
                                <Decorator Height="53"/>
                                <Grid Style="{StaticResource A_FrameworkElement_RewardIcon_Size}"
                                      DataContext="{Binding EventReward}">
                                    <Control Template="{StaticResource A_ControlTemplate_RewardThumbnailOnly}"/>
                                </Grid>
                                <StackPanel HorizontalAlignment="Center"
                                            VerticalAlignment="Bottom"
                                            Margin="0,0,0,25">
                                    <FZTextBlock  HorizontalAlignment="Center" 
                                                  Text="{Binding EventRewardTitle}"
                                                  Style="{StaticResource A_Style_FZTextBlock_HorizonA}"
                                                  Color="{StaticResource H_Color_Primary_Green}"
                                                  CapHeight="18"
                                                  Margin="0,0,0,12"/>
                                    <FZTextBlock  HorizontalAlignment="Center"  
                                                  Text="{Binding EventObjective}"
                                                  Style="{StaticResource A_Style_FZTextBlock_HorizonA}"
                                                  Color="{StaticResource H_Color_Primary_White}"
                                                  CapHeight="18"/>
                                </StackPanel>
                            </StackPanel>
                        </local:FZMaterial>
                    </Grid>
                    <Grid Visibility="{Binding SelectedTab.TabType, RelativeSource={RelativeSource AncestorType=Page}, 
                                        Converter={StaticResource A_TabType_Is_Track}, FallbackValue=Collapsed}">
                        <Control Width="512" 
                                Height="340" 
                                Margin="0"
                                Style="{StaticResource A_Style_Event_RaceInfoPanel_PreRace}" 
                                DataContext="{Binding EventInfoDataView, RelativeSource={RelativeSource AncestorType=Page}}"/>
                        <FZMaterial Width="472" 
                                    Height="300" 
                                    Color="{StaticResource H_Color_Primary_Black}" >
                            <local:FZMaterial.OpacityMask>
                                <LinearGradientBrush StartPoint="0,0"
                                                EndPoint="0, 1">
                                    <GradientStop Color="{StaticResource H_Color_Glass_Purple_40pc}"
                                        Offset="0" />
                                    <GradientStop Color="{StaticResource A_Color_Transparent}"
                                            Offset="0.5" />
                                    <GradientStop Color="{StaticResource H_Color_Glass_Purple_40pc}"
                                            Offset="1" />
                                </LinearGradientBrush>
                            </local:FZMaterial.OpacityMask>
                        </FZMaterial>
                        <StackPanel>
                            <!-- 
                            Forte bug 4363377 requires a last minute removal of a textblock that was here, but that changed the layout of the reward cars slightly
                            the 53 pixel decorator now exists so the layout will remain unaffected, and just the text block can be gone
                            -->
                            <Decorator Height="53"/>
                            <StackPanel Orientation="Vertical"
                                        Visibility="{Binding CampaignSetup.DisplayCarRestriction, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                <local:FZTextBlock Text="{local:Loc DestinationMenu.IDS_FestivalPass_CarRestriction}"
                                                    Style="{StaticResource A_Style_FZTextBlock_HorizonB}"
                                                    HorizontalAlignment="Center"  
                                                    CapHeight="18"
                                                    Margin="0,0,0,10" 
                                                    Color="{StaticResource A_Color_White}"/>
                                <DockPanel Height="30" LastChildFill="False" DataContext="{Binding CampaignSetup}">
                                    <Control Style="{StaticResource A_Style_Control_OnlineFlyerCarClass}" 
                                                Margin="120,0,15,0"/>
                                    <local:FZTextBlock Text="{Binding CampaignSetup.CarRestrictionDescription, RelativeSource={RelativeSource AncestorType=Page}}"
                                                        Style="{StaticResource A_Style_FZTextBlock_HorizonB}"
                                                        CapHeight="18"
                                                        VerticalAlignment="Center"
                                                        Color="{StaticResource A_Color_White}"/>
                                </DockPanel>
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </Grid>
            </DataTemplate>

            <DataTemplate DataType="{x:Type StarScoringConvoyTypeMenuItem}">
                <DataTemplate.Resources>
                    <MappingConverter x:Key="A_Converter_IsTabType_Track_to_Visibility" Default="{x:Static Visibility.Collapsed}">
                        <MappingConverterEntry Key="{x:Static CampaignSlotTabType.Track}" Value="{x:Static Visibility.Visible}"/>
                    </MappingConverter>
                    <MappingConverter x:Key="A_Converter_IsTabType_RaceRequirments_to_Visibility" Default="{x:Static Visibility.Collapsed}">
                        <MappingConverterEntry Key="{x:Static CampaignSlotTabType.RaceRequirments}" Value="{x:Static Visibility.Visible}"/>
                    </MappingConverter>
                </DataTemplate.Resources>
                <Grid>
                    <FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/PatternBackground.png"
                                VerticalAlignment="Top"
                                Height="216"/>
                    <Control x:Name="RaceInfoMap"
                             Style="{StaticResource A_Style_Event_RaceInfoPanel_PreRace}" 
                             Margin="0,0,0,2"
                             Width="512" 
                             Height="{StaticResource A_RaceInfo_Panel_Height_With_Tabs}"  
                             DataContext="{Binding EventInfoDataView, RelativeSource={RelativeSource AncestorType=Page}}"
                             Visibility="{Binding SelectedTab.TabType, RelativeSource={RelativeSource AncestorType=Page}, 
                                        Converter={StaticResource A_Converter_IsTabType_Track_to_Visibility}, FallbackValue=Collapsed}"/>
                    
                    <Grid Visibility="{Binding SelectedTab.TabType, RelativeSource={RelativeSource AncestorType=Page}, 
                                        Converter={StaticResource A_Converter_IsTabType_RaceRequirments_to_Visibility}, FallbackValue=Collapsed}">
                        <StackPanel HorizontalAlignment="Center"
                                    Margin="0,60,0,0">
                            <FZTextBlock Text="{Loc MyProfile.IDS_PersonalBest}"
                                        Style="{StaticResource A_Style_FZTextBlock_Title_Small}"
                                        Color="{StaticResource H_Color_Primary_White}"
                                        HorizontalAlignment="Center"/>
                            <FZMaterial Color="{StaticResource H_Color_Primary_White}"
                                        Width="295"
                                        Height="2"
                                        Margin="0,15"/>
                            <FZTextBlock x:Name="PersonalBestTime"
                                         Text="{Binding PersonalBest}"
                                         Style="{StaticResource A_Style_FZTextBlock_Heading_Medium}"
                                         HorizontalAlignment="Center"
                                         Color="{StaticResource H_Color_Primary_Yellow}"/>
                        </StackPanel>

                        <StackPanel Orientation="Horizontal"
                                    VerticalAlignment="Bottom"
                                    HorizontalAlignment="Center"
                                    Margin="0,20">
                            <ContentControl Style="{StaticResource A_Style_StarConditions}"
                                            Tag="1"
                                            BindingProxy.A="{Binding OneStarData.Completed}"
                                            Content="{Binding OneStarData.Time}"/>
                            <ContentControl Style="{StaticResource A_Style_StarConditions}"
                                            Tag="2"
                                            BindingProxy.A="{Binding TwoStarData.Completed}"
                                            Content="{Binding TwoStarData.Time}"/>
                            <ContentControl Style="{StaticResource A_Style_StarConditions}"
                                            Tag="3"
                                            BindingProxy.A="{Binding ThreeStarData.Completed}"
                                            Content="{Binding ThreeStarData.Time}"/>
                        </StackPanel>
                    </Grid>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding CompletedRace}" Value="False">
                        <Setter TargetName="PersonalBestTime" Property="Color" Value="{StaticResource H_Color_Primary_Grey_70pc}"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate DataType="{x:Type HorizonJobsItem}">
                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                    <FZMaterial Height="225" Width="252" Margin="0,0,0,14" ImageSource="{Binding JobLevelIcon}" Margin="0,-20,0,10"/>
                    <FZTextBlock Text="{Binding JobLevelTitle}"
                                 Style="{StaticResource A_Style_FZTextBlock_Heading_Medium}"
                                 Color="{StaticResource H_Color_Primary_White}"
                                 FontFamily="Horizon_B"
                                 TextWrapping="Wrap"
                                 TextAlignment="Center"
                                 Margin="0,0,0,25"/>
                    <FZTextBlock Text="{local:Loc BucketList.IDS_HorizonJob_Max_Level}"
                                 HorizontalAlignment="Center" 
                                 Color="{StaticResource H_Color_Primary_White}"
                                 Style="{StaticResource A_Style_FZTextBlock_Heading_Medium}" 
                                 Margin="0,0,0,14" 
                                 CapHeight="27"
                                 MarkupConverter="{StaticResource A_MappingConverter_Yellow_Title}"
                                 Visibility="{Binding IsMaxLevel, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                    <StackPanel HorizontalAlignment="Center" 
                                Orientation="Horizontal" 
                                Margin="0,0,0,14" 
                                Visibility="{Binding IsMaxLevel, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                        <Control Style="{StaticResource H_Style_Control_CreditsIcon}"
                                 HorizontalAlignment="Center"
                                 HorizontalAlignment="Center"
                                 Margin="-4,-4,4,-4"/>
                        <FZTextBlock VerticalAlignment="Center" 
                                     HorizontalAlignment="Center"
                                     Style="{StaticResource A_Style_FZTextBlock_Heading_Medium}"
                                     CapHeight="27"
                                     Color="{StaticResource H_Color_Primary_White}">
                            <FZRun Text="{Binding CurrentAmount, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}" Color="{StaticResource A_Color_Job_Yellow_Highlight}"/>
                            <FZRun Text="/"/>
                            <FZRun Text="{Binding MaxAmount, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"/>
                        </FZTextBlock>
                    </StackPanel>
                    <FZMaterial Width="351" 
                                Height="25" 
                                Color="{StaticResource H_Color_Primary_Black}"
                                Preset="{Roundtangle CornerRadius=12}">
                        <FZMaterial Width="343"
                                Height="17"
                                Color="#4D4D4D"
                                Preset="{Roundtangle CornerRadius=7}" >
                            <ProgressBar x:Name="Reward_Reveal_ProgressBar"
                                                 Style="{StaticResource A_Style_ProgressBar_Jobs}"
                                                 Width="343"
                                                 Height="17"  
                                                 Minimum="{Binding MinAmount, Converter={StaticResource A_IntToFloatConverter}}"
                                                 Maximum="{Binding MaxAmount, Converter={StaticResource A_IntToFloatConverter}}"
                                                 Value="{Binding CurrentAmount, Converter={StaticResource A_IntToFloatConverter}}"/>
                        </FZMaterial>
                    </FZMaterial>
                </StackPanel>
            </DataTemplate>

            <DataTemplate DataType="{x:Type HorizonStoriesSoloCoopItem}">
                <StackPanel DataContext="{Binding RelativeSource={RelativeSource AncestorType=Page}}"
                            Orientation="Vertical"
                            VerticalAlignment="Top">

                    <FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/PatternBackground.png"
                                HorizontalAlignment="Stretch"
                                Height="216"
                                Margin="0,20,0,0">
                        <FZMaterial ImageSource="{Binding ScreenTitleIcon}"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Width="120"
                                    Height="120"/>
                    </FZMaterial>

                    <FZTextBlock Color="{StaticResource H_Color_Primary_White}" 
                                 CapHeight="22" 
                                 Text="{local:Loc Map.IDS_MapPin_Story_TotalStars}"
                                 VerticalAlignment="Center"
                                 HorizontalAlignment="Center"/>
                    
                    <FZMaterial Width="295" Height="2"
                                HorizontalAlignment="Center"
                                Color="{StaticResource H_Color_Primary_White}"
                                Margin="20"/>

                    <FZTextBlock VerticalAlignment="Center" 
                                     HorizontalAlignment="Center"
                                     Style="{StaticResource A_Style_FZTextBlock_Heading_Medium}"
                                     CapHeight="32"
                                     Color="{StaticResource H_Color_Primary_White}">
                        <FZRun Text="{Binding StarsGained, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}" Color="{StaticResource A_Color_Job_Yellow_Highlight}"/>
                        <FZRun Text="/"/>
                        <FZRun Text="{Binding StarsTotal, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"/>
                    </FZTextBlock>
                    
                </StackPanel>
            </DataTemplate>

            <Style x:Key="A_ContentControl_PreRace_Info_Panel" TargetType="ContentControl">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ContentControl">
                            <FZMaterial x:Name="BackgroundMaterial"
                                        Width="512" 
                                        Height="400"
                                        Color="{StaticResource H_Color_Glass_Purple_20pc}" 
                                        Style="{StaticResource A_FZMaterial_Info_Panel_Background}">
                                <Grid>
                                    <ContentPresenter />
                                </Grid>
                            </FZMaterial>
                            <ControlTemplate.Triggers>
                                <DataTrigger Binding="{Binding Tabs.Count, Converter={StaticResource A_CompareConverter}, ConverterParameter=1}"
                                             Value="{x:Static local:CompareResult.GreaterThan}">
                                    <Setter TargetName="BackgroundMaterial" Property="Height" Value="342"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding ScreenSubtitle, Converter={StaticResource H_TrueIfNotNull}}" Value="True">
                                    <Setter TargetName="BackgroundMaterial" Property="Height" Value="342"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding SceneEnum, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Page}}}" Value="{x:Static local:SceneEntryEnum.HorizonStoriesSoloCoopSlotMenu}">
                                    <Setter TargetName="BackgroundMaterial" Property="Height" Value="400"/>
                                </DataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <local:MappingConverter x:Key="A_Converter_EventInfo_Toggle_Bool_To_String">
                <local:MappingConverterEntry Key="False" Value="{local:Loc HelpButtons.IDS_ViewEventInformation}"/>
                <local:MappingConverterEntry Key="True" Value="{local:Loc HelpButtons.IDS_HideEventInformation}"/>
            </local:MappingConverter>
        </ResourceDictionary>
    </Page.Resources>

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

    <Grid x:Name="PART_LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualState x:Name="PART_CollapsedDescription" Storyboard="{StaticResource A_Storyboard_Description_Collapsed}"/>
                <VisualState x:Name="PART_OnlineSeasonalChampionship" Storyboard="{StaticResource A_Storyboard_OnlineSeasonalChampionship_Mode}"/>
                <VisualState x:Name="PART_OnlineSeasonalChampionship_Games" Storyboard="{StaticResource A_Storyboard_OnlineSeasonalChampionship_Games_Mode}"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

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

        <Control x:Name="DefaultBackground"
                 Style="{StaticResource A_Style_Control_ScreenBackground}" />

        <PageInputHandler 
            x:Name="AdditionalInfoButtonInput"
            Command="{Binding XCommand}"
            Button="X" />
           
        <PageInputHandler x:Name="MoreInfoButtonInput" Button="R3"
                          Command="{Binding ToggleEventInfoCommand, RelativeSource={RelativeSource AncestorType=Page}}" />
        <ContentControl Style="{StaticResource A_Style_ButtonBar}"
                        x:Name="BottomBar">
            <ControllerButtonPanel x:Name="PART_HelpPanel"
                                 Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <ControllerButtonControl Button="A"
                                         Description="{Loc HelpButtons.IDS_Select}" />
                <ControllerButtonControl Button="B"
                                         Description="{Loc HelpButtons.IDS_Back}" />
                <ControllerButtonControl Button="X"
                                         Description="{Binding XDescription}"
                                         Visibility="{Binding Command, Converter={FZBooleanToVisibilityConverter}, FallbackValue=Collapsed, ElementName=AdditionalInfoButtonInput}"/>
                <ControllerButtonControl Button="{Binding Button, ElementName=MoreInfoButtonInput}"
                                         Description="{Binding PosterEventInfoDataView.Show, Converter={StaticResource A_Converter_EventInfo_Toggle_Bool_To_String}}"
                                         Visibility="{Binding Command.Enabled, Converter={StaticResource A_FZBooleanToVisibilityConverter}, ElementName=MoreInfoButtonInput, FallbackValue=Collapsed}" />
                <ControllerButtonControl Button="Y"
                                         Description="{Binding SwitchEventMenu, Converter={StaticResource A_Converter_CampaignSwitchEventToSwitchEventString}}" />
            </ControllerButtonPanel>
        </ContentControl>
        <local:NetworkCountdownControl Style="{StaticResource A_Style_NetworkCountdownControl_EventSetup}" />
        <Border Style="{StaticResource A_Style_Border_ScenePadding}"
                ClipToBounds="false">
            <Grid ClipToBounds="false"  Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}">
                <DockPanel HorizontalAlignment="Left"
                           Height="{StaticResource A_SlotMenu_Panel_Height_With_Tile}">
                    <Grid DockPanel.Dock="Right">
                        <local:Decorator x:Name="CountDownPanel" 
                                         Height="50"
                                         MinWidth="200"
                                         Visibility="{Binding TimeRemaining, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_StringVisConverter}, FallbackValue=Collapsed}"
                                         VerticalAlignment="Top"
                                         HorizontalAlignment="Center"
                                         ScreenReader.LineType="{Static ScreenReaderLineType.NetworkCountdown}"
                                         ScreenReader.Event="{Static ScreenReaderEvent.OnChange}"
                                         ScreenReader.InterruptBehavior="WaitForNonePlaying"
                                         MultiStringFormatter.Format="{}{0} {1}"
                                         MultiStringFormatter.Param0="{Binding Text, ElementName=CountDownLabel}"
                                         MultiStringFormatter.Param1="{Binding Text, ElementName=CountDownTime}"
                                         ManualPassthroughProperty.Allowed="{Binding IsVisible, RelativeSource={RelativeSource Self}}"
                                         ManualPassthroughProperty.Input="{Binding (MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"
                                         ScreenReader.Line="{Binding (ManualPassthroughProperty.Output), RelativeSource={RelativeSource Self}}">
                            <StackPanel Orientation="Horizontal">
                                <local:FZMaterial x:Name="ClockIcon" 
                                                  Width="40"
                                                  Height="40"
                                                  x:Name="TimerIcon"
                                                  VerticalAlignment="Center"
                                                  Margin="0,-20"
                                                  ImageSource="/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/Timer.png"/>
                                <local:FZTextBlock x:Name="CountDownLabel"
                                                   Text="{local:Loc EventBlueprint.IDS_Next_Event_Begins_In}"
                                                   Style="{StaticResource H_Style_Text_ScreenTitle}"
                                                   FontFamily="Horizon_A_tf"
                                                   Margin="0,10,3,10"/>
                                <Decorator RenderTransform="{StaticResource A_Transform_Italic}"
                                           RenderTransformOrigin="0.5,0.5">
                                    <local:FZTextBlock x:Name="CountDownTime"
                                                       Text="{Binding TimeRemaining, RelativeSource={RelativeSource AncestorType=Page}}"
                                                       Style="{StaticResource H_Style_Text_ScreenTitle}"
                                                       FontFamily="Horizon_A_tf"
                                                       Color="{StaticResource H_Color_Primary_Yellow}"
                                                       CapHeight="23"
                                                       Margin="3,10,30,10"/>
                                </Decorator>
                            </StackPanel>
                        </local:Decorator>
                        <Grid x:Name="PostersRoot"
                              Margin="4,0,0,0"
                              Panel.ZIndex="0"
                              Height="708" 
                              Width="442"
                              VerticalAlignment="Bottom"
                              >
                            <ContentControl x:Name="FlyerStory"
                                            DataContext="{Binding StoryPoster}"
                                            Style="{StaticResource A_Style_Control_CampaignFlyer}"
                                            Visibility="{Binding IsStoryPosterShown, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}"/>
                            <ContentControl x:Name="FlyerRace"
                                            DataContext="{Binding EventInfoDataView.CampaignSetupItem}"
                                            Style="{StaticResource A_Style_Control_CampaignFlyer}"
                                            Visibility="{Binding IsRacePosterShown, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}"/>
                            <ContentControl x:Name="FlyerSeasonal"
                                            DataContext="{Binding CampaignSetup}"
                                            Style="{StaticResource A_Style_Control_CampaignFlyer}"
                                            Visibility="{Binding ShowSeasons, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}"/>
                        </Grid>
                    </Grid>
                    <Decorator  Visibility="{Binding BucketListSetup, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}">
                        <Grid HorizontalAlignment="Center"
                              VerticalAlignment="Bottom"
                              Margin="0,0,18,109">
                            <Viewbox Stretch="Uniform">
                                <Control Template="{StaticResource A_ControlTemplate_Control_BucketListFlyer_Internal}" 
                                         DataContext="{Binding BucketListSetup}"
                                         FontSize="{StaticResource A_Double_FlyerRotation_FrontFaceShowing}"/>
                            </Viewbox>
                        </Grid>
                    </Decorator>

                    <DockPanel VerticalAlignment="Center"
                                HorizontalAlignment="Left"
                                ClipToBounds="false"
                                Width="{StaticResource A_SlotMenu_Panel_Width}">
                        <Decorator x:Name="TitleRoot"
                                    Visibility="{Binding HideTitleUI, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"
                                    HorizontalAlignment="Left" 
                                    Width="{StaticResource A_SlotMenu_Panel_Width}"
                                    DockPanel.Dock="Top">
                            <ContentControl x:Name="ContentControl_SceneTitle"
                                            Content="{Binding ScreenTitle}"
                                            Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                            Margin="0,0,0,4"
                                            Visibility="{Binding ScreenTitle, Converter={StaticResource A_StringVisConverter}, FallbackValue=Collapsed}"/>
                        </Decorator>
                        <DockPanel Height="{StaticResource A_SlotMenu_Panel_Height}">
                            <Decorator x:Name="SubTitleRoot"
                                       DockPanel.Dock="Top"
                                       Width="{StaticResource A_SlotMenu_Panel_Width}"
                                       Visibility="{Binding HideTitleUI, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                                <ContentControl Style="{StaticResource A_Style_ContentControl_Header}"
                                                Content="{Binding ScreenSubtitle}"
                                                Visibility="{Binding ScreenSubtitle, Converter={StaticResource A_StringVisConverter}, FallbackValue=Collapsed}"
                                                HorizontalContentAlignment="Center"/>
                            </Decorator>
                            <StackPanel x:Name="ContentRoot"
                                        HorizontalAlignment="Center"
                                        Margin="0,0,0,2" 
                                        DockPanel.Dock="Top"> 
                                <FZTabButtonsSelector 
                                    Name="PART_Tabs"
                                    Style="{StaticResource A_Style_SlotMenu_TabBar}"  
                                    SelectedIndex="0"
                                    SelectedItem="{Binding SelectedTab, Mode=TwoWay}"
                                    ItemsSource="{Binding Tabs}"              
                                    Width="512"
                                    Visibility="{Binding Tabs.Count, Converter={StaticResource H_VisibleIfGreaterThanOne}, FallbackValue=Collapsed}">
                                </FZTabButtonsSelector>

                                <ContentControl Content="{Binding SelectedSlotItem}"
                                                Style="{StaticResource A_ContentControl_PreRace_Info_Panel}"/>
                            </StackPanel>

                            <DockPanel x:Name="SelectorsAndDescriptionRoot"
                                        LastChildFill="True" >
                                <!--Standard slot menu-->
                                <StackPanel x:Name="SlotMenu"
                                            local:ZPanel.SortByDepth="True"
                                            DockPanel.Dock="Top"
                                            Margin="0,0,0,2"
                                            Panel.ZIndex="1">
                                    <Decorator> 
                                        <local:WrapListBox x:Name="PART_ItemListBox"
                                                            ItemsSource="{Binding Items}"
                                                            ScrollOrientation="Vertical"
                                                            AllowMouseWheelScrolling="False"
                                                            Template="{StaticResource H_ControlTemplate_Carousel_Default}"
                                                            ItemWidth="512" 
                                                            ItemHeight="54"
                                                            SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
                                                            SelectedItem="{Binding SelectedSlotItem, Mode=TwoWay}"
                                                            ItemTemplate="{StaticResource A_DataTemplate_ListItem_CampaignSlotMenuItem}"
                                                            ItemContainerStyle="{StaticResource A_Style_CampaignSlotMenu_ListBoxItem}"
                                                            local:FocusOnPageFocusGained.SelectorSelectedItem="True"
                                                            OverrideAcrossNavigation="True"
                                                            Panel.ZIndex="1"
                                                            MultiDataConversion.Converter="{MathOperationConverter Operation=Multiply}"
                                                            MultiDataConversion.TargetType="{Type Double}"
                                                            MultiDataConversion.Value="{Binding ItemsSource.Count, RelativeSource={RelativeSource Self}}"
                                                            MultiDataConversion.Parameter="{StaticResource A_Double_SlotMenu_WrapPanel_ItemsPerRow}"
                                                            Height="{Binding (MultiDataConversion.Output), RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_SlotMenu_RowsToHeight}}" />
                                    </Decorator>
                                </StackPanel>
                                <!--Standard description panel for many screens using this menu-->
                                <FZMaterial x:Name="DescriptionPanel"
                                            DataContext="{Binding SelectedSlotItem}"
                                            DockPanel.Dock="Bottom"
                                            Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"
                                            Color="{StaticResource H_Color_Glass_Purple_20pc}"
                                            Panel.ZIndex="0">
                                    <Grid ClipToBounds="True"
                                            Margin="15,10,15,15">
                                        <FZTextBlock Text="{Binding Description}"
                                                    Style="{StaticResource A_Style_FZTextBlock_HorizonB}"
                                                    MarkupConverter="{StaticResource A_MappingConverter_Bold_Description}"
                                                    HorizontalAlignment="Left"
                                                    CapHeight="18"
                                                    VerticalAlignment="Top"
                                                    TextWrapping="Wrap"
                                                    Color="{StaticResource A_Color_White}"
                                                    Stretch="None"
                                                    Margin="0,5,0,0"
                                                    AutoScroll.AllowScrolling="True"
                                                    AutoScroll="{StaticResource H_AutoScrollSettings_Descriptions}"
                                                    local:ScreenReader.Event="OnChange"
                                                    local:ScreenReader.ControlType="None"
                                                    local:ScreenReader.Line="{Binding DescriptionScreenReader, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                                                    local:ScreenReader.LineType="ItemDescription"/>
                                    </Grid>
                                </FZMaterial>
                            </DockPanel>

                            <!--Special menu for Championship list-->
                            <Grid x:Name="OnlineSeasonalMenu" Visibility="Collapsed"
                                    local:ZPanel.SortByDepth="True"
                                    Margin="0,2,0,0"
                                    Panel.ZIndex="1"
                                    DockPanel.Dock="Top">
                                <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}">
                                    <local:WrapListBox x:Name="PART_OnlineItemList"
                                                       ItemsSource="{Binding Items}"
                                                       ScrollOrientation="Vertical"
                                                       AllowMouseWheelScrolling="False"
                                                       Template="{StaticResource H_ControlTemplate_Carousel_Default}"
                                                       Style="{StaticResource A_Style_ListBox_CampaignSlotMenu}"
                                                       ItemWidth="512" 
                                                       ItemHeight="54"
                                                       ItemTemplate="{StaticResource A_DataTemplate_ListItem_CampaignSlotMenuItem}"
                                                       ItemContainerStyle="{StaticResource A_Style_CampaignSlotMenu_ListBoxItem}"
                                                       local:FocusOnPageFocusGained.SelectorSelectedItem="True"
                                                       OverrideAcrossNavigation="True"
                                                       Panel.ZIndex="1"
                                                       MultiDataConversion.Converter="{MathOperationConverter Operation=Multiply}"
                                                       MultiDataConversion.TargetType="{Type Double}"
                                                       MultiDataConversion.Value="{Binding ItemsSource.Count, RelativeSource={RelativeSource Self}}"
                                                       MultiDataConversion.Parameter="{StaticResource A_Double_SlotMenu_WrapPanel_ItemsPerRow}"
                                                       Height="{Binding (MultiDataConversion.Output), RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_SlotMenu_RowsToHeight}}"/>
                                </Decorator>
                            </Grid>

                            <!--Special description panel for Online Seasonal Championsip screen-->
                            <local:FZMaterial x:Name="OnlineSeasonalEventDescription"
                                              DockPanel.Dock="Top"
                                              Visibility="Collapsed"
                                              MaxWidth="716"
                                              Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"
                                              MinHeight="80"
                                              Margin="0,2,0,0"
                                              Panel.ZIndex="0">
                                <StackPanel>
                                    <local:FZTextBlock Text="{Binding ChampionshipDescription}"
                                                        Style="{StaticResource A_Style_FZTextBlock_HorizonD}"
                                                        MarkupConverter="{StaticResource A_MappingConverter_Bold_Description}"
                                                        HorizontalAlignment="Left"
                                                        VerticalAlignment="Top" TextWrapping="Wrap"
                                                        Margin="21,20,21,20"
                                                        Color="{StaticResource A_Color_White}"
                                                        local:ScreenReader.Event="OnChange"
                                                        local:ScreenReader.ControlType="None"
                                                        local:ScreenReader.Line="{Binding ChampionshipDescription, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                                                        local:ScreenReader.LineType="ItemDescription"/>
                                </StackPanel>
                            </local:FZMaterial>
                        </DockPanel>
                    </DockPanel>
                </DockPanel>        

                                    
                <Decorator>
                    <Decorator.RenderTransform>
                        <TranslateTransform X="225" Y="150"/>
                    </Decorator.RenderTransform>
                    <Grid Visibility="{Binding PosterEventInfoDataView.Show, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden}, FallbackValue=Hidden}">
                        <Control Style="{StaticResource A_Style_Event_RaceInfo_PreRace_FlyerPopup}"
                                 DataContext="{Binding PosterEventInfoDataView, RelativeSource={RelativeSource AncestorType=Page}}"/>
                    </Grid>
                </Decorator>
            </Grid>
        </Border>
    </Grid>
</Page>
