<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>
            <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="Tag" Storyboard.TargetName="SeasonObjectives">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="Championship"/>
                </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>
                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Text" Storyboard.TargetName="SeasonObjectivesTitle">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="{local:Loc EventBlueprint.IDS_SeasonChampionship}"/>
                </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="Tag" Storyboard.TargetName="SeasonObjectives">
                    <DiscreteObjectKeyFrame KeyTime="0" Value="Championship"/>
                </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">
                <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="ListBoxItem">
                <Setter Property="Margin" Value="0,0,6,0" />
                <Setter Property="Focusable" Value="False" />
                <Setter Property="local:RecursiveFocusOnMouseOverBehaviour.Self" Value="True" />
                <Setter Property="Panel.ZIndex" Value="0"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem" >
                            <Grid>
                                <ContentPresenter />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="IsKeyboardFocusWithin" Value="True">
                        <Setter Property="Panel.ZIndex" Value="5"/>
                        <Setter Property="Selector.IsSelected" Value="True"/>
                    </Trigger>
                </Style.Triggers>
            </Style>

           <!--Custom button style with required properties to be compatible with Shared_TiledMenus highlight storyboard effect-->
            <Style x:Key="A_Style_Button_Tile_CampaignSlotMenu" TargetType="local:FZButton" >
                <Setter Property="Command" Value="{Binding SelectCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                <Setter Property="Width" Value="210"/>
                <Setter Property="Height" Value="168"/>
                <Setter Property="local:ZPanel.ZOffset" Value="0"/>
                <Setter Property="RenderTransformOrigin"
                        Value="0.5,0.5" />
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsKeyboardFocused}" Value="True">
                        <DataTrigger.EnterActions>
                            <BeginStoryboard Storyboard="{StaticResource A_Storyboard_Tile_Selected}"/>
                        </DataTrigger.EnterActions>
                        <DataTrigger.ExitActions>
                            <BeginStoryboard Storyboard="{StaticResource A_Storyboard_Tile_Unselected}"/>
                        </DataTrigger.ExitActions>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_ComingSoonBanner_Base" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="Text" Value="{local:Loc TiledMenus.IDS_ComingSoonBanner}"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
                <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>
            <Style x:Key="A_LocalizedStyle_FZTexblock_ComingSoonBanner" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ComingSoonBanner_Base}"/>
            <Style x:Key="A_LocalizedStyle_FZTexblock_ComingSoonBanner_CHS" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ComingSoonBanner_Base}">
                <Setter Property="TextWrapping" Value="NoWrap"/>
            </Style>
            <Style x:Key="A_LocalizedStyle_FZTexblock_ComingSoonBanner_CHT" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ComingSoonBanner_Base}">
                <Setter Property="TextWrapping" Value="NoWrap"/>
            </Style>
            <Style x:Key="A_LocalizedStyle_FZTexblock_ComingSoonBanner_JP" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ComingSoonBanner_Base}">
                <Setter Property="TextWrapping" Value="NoWrap"/>
            </Style>
            <Style x:Key="A_LocalizedStyle_FZTexblock_ComingSoonBanner_HU" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ComingSoonBanner_Base}">
                <Setter Property="TextWrapping" Value="NoWrap"/>
            </Style>

            <!--Button template-->
            <ControlTemplate x:Key="A_ControlTemplate_IconTile_SlotMenu" TargetType="{x:Type local:FZButton}">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition}" Margin="0,1,0,0">
                    <local:FZMaterial x:Name="DropShadow" Opacity="0.6" Visibility="Hidden" Margin="-25,-15"
                                      Style="{StaticResource A_Style_FZMaterial_ShadowBase_ForSubgraph}">
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GlassPanel_Pill}" Color="{StaticResource A_Color_GlassPanel_Interactive}"/>
                    <local:FZMaterial x:Name="IconBackground" Color="{StaticResource A_Color_WhitePanel}"
                                      Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"/>
                    <local:FZMaterial x:Name="Icon" ImageSource="{Binding Icon}" Stretch="UniformToFill" Color="{StaticResource A_Color_SmallTile_Icon}"/>
                    <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" 
                                           local:TextBlockInlineMarkup.Markup="{Binding Heading, Converter={StaticResource A_StringToUpper}}" Color="{StaticResource A_Color_Tile_Text}"
                                           Style="{StaticResource A_Style_FZTextBlock_TileText}"
                                           HorizontalAlignment="Center" VerticalAlignment="Bottom"
                                           Margin="24,18"
                                           CapHeight="21" />
                    <local:FZMaterial x:Name="PadLock" Margin="6" Width="36" Height="36" VerticalAlignment="Top" HorizontalAlignment="Right" Visibility="Collapsed"
                                      Color="{StaticResource A_Color_Tile_Background_Locked}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}">
                        <local:FZMaterial Width="27" Height="28" Margin="9,8" HorizontalAlignment="Center" VerticalAlignment="Center"
                                          ImageSource="/ForzaUI;component/Textures/Anthem/Icons/Pad_Lock.png"/>
                    </local:FZMaterial>
                    <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="{local:LocalizedResource A_LocalizedStyle_FZTexblock_ComingSoonBanner}" />
                            </Decorator>
                        </Decorator>
                    </local:FZMaterial>
                    <ContentControl Style="{StaticResource A_Style_ContentControl_TileSelectionStroke}" Focusable="False"/>
                </Grid>
                <ControlTemplate.Triggers>
                    <!--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="Icon" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="StarPanel" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding StarCount}" Value="3">
                        <Setter TargetName="IconBackground" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/CampaignSlot_Gold.png" />
                        <Setter TargetName="SlotText" Property="Color" Value="#7F000000"/>
                    </DataTrigger>
                    
                    <!--Lock state trigger.-->
                    <DataTrigger Binding="{Binding LockState}" Value="{x:Static local:LockState.Locked}">
                        <Setter TargetName="IconBackground" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="Icon" Property="Color" Value="{StaticResource A_Color_White}" />
                        <Setter TargetName="SlotText" Property="Color" Value="{StaticResource A_Color_White}"/>
                        <Setter TargetName="SlotText" Property="Opacity" Value="0.6"/>
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding LockState}" 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"/>
                        <Setter TargetName="Icon" Property="Opacity" Value="0.6"/>
                        <Setter TargetName="Icon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/SlotMenu/Locked.png" />
                    </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>
                </ControlTemplate.Triggers>
            </ControlTemplate >

            <!--Item Template for slotmenu-->
            <DataTemplate x:Key="A_DataTemplate_ListItem_CampaignSlotMenuItem">
                <local:FZButton Style="{StaticResource A_Style_Button_Tile_CampaignSlotMenu}"
                    local:TileMenuNavigationManager.TileState="{Binding TileState}"
                    Template="{StaticResource A_ControlTemplate_IconTile_SlotMenu}"
                    local:ScreenReader.ControlType="Button"
                    local:ScreenReader.Event="OnFocus"
                    local:ScreenReader.SelectedNumber="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"
                    local:ScreenReader.SelectedCount="{Binding Items.Count, RelativeSource={RelativeSource AncestorType=ListBox}}"
                    local:ScreenReader.Line="{Binding Heading, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                    local:ScreenReader.LineType="SelectedItem" />
            </DataTemplate>

            <!-- ListBox Style for slotmenu -->
            <Style x:Key="A_Style_ListBox_CampaignSlotMenu_ItemList" TargetType="local:CommonListBox">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBox">
                            <StackPanel KeyboardNavigation.DirectionalNavigation="Contained" Orientation="Horizontal" IsItemsHost="True" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="ItemTemplate" Value="{StaticResource A_DataTemplate_ListItem_CampaignSlotMenuItem}"/>
                <Setter Property="ItemContainerStyle" Value="{StaticResource A_Style_ListBoxItem_CampaignSlotMenu}"/>
            </Style>

            <!--Item Template for List-->
            <DataTemplate x:Key="A_DataTemplate_ListItem_CampaignItemMenuItem">
                <local:FZButton Style="{StaticResource A_Style_Button_EmptyButton}" Command="{Binding OnSelectCommand}" >
                    <local:FZMaterial VerticalAlignment="Center" Height="52" Width="642" Color="#00000000">
                        <Grid>
                            <local:FZTextBlock x:Name="ListItemText" HorizontalAlignment="Left" Margin="18,0" 
                                                   Text="{Binding ItemText, Converter={StaticResource A_StringToUpper}}"
                                                   Style="{StaticResource A_Style_FZTextBlock_OptionText}"
                                                   local:AccumulateSelfOnParent.ParentName="CampaignList"
                                                   local:AccumulateSelfOnParent.SortOrder="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
                                                   local:FindSelfIndexInCollection.Collection="{Binding (local:AccumulateSelfOnParent.Output), ElementName=CampaignList}"
                                                   local:ScreenReader.SelectedNumber="{Binding (local:FindSelfIndexInCollection.Index), RelativeSource={RelativeSource Self}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"
                                                   local:ScreenReader.SelectedCount="{Binding (local:AccumulateSelfOnParent.Output).Count, ElementName=CampaignList, FallbackValue=0}"
                                                   local:ScreenReader.Event="OnChange"
                                                   local:ScreenReader.ControlType="Button"
                                                   local:ScreenReader.LineType="SelectedItem" />
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="18,0" >
                                <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Visibility="{Binding ItemSubText, Converter={StaticResource A_StringVisConverter}}">
                                    <local:FZTextBlock Text="{Binding ItemSubText}"
                                                   FontFamily="Horizon_A" Margin="0,0,-12,0" HorizontalAlignment="Left"
                                                   Style="{StaticResource A_Style_FZTextBlock_OptionText}"/>
                                    <Decorator Width="80" HorizontalAlignment="Right">
                                        <local:FZTextBlock x:Name="CountDown" Text="{Binding TimeRemaining, RelativeSource={RelativeSource AncestorType=Page}}"
                                                       FontFamily="Horizon_A" Color="{StaticResource A_Color_Opaque_Highlight}"
                                                       Style="{StaticResource A_Style_FZTextBlock_OptionText}" HorizontalAlignment="Center"/>
                                    </Decorator>
                                </StackPanel>
                                <local:FZMaterial x:Name="LockIcon" Width="27" Height="28" Color="{StaticResource A_Color_TextMenu_Text_Default}"
                                                  Visibility="Collapsed" ImageSource="/ForzaUI;component/Textures/Anthem/Icons/Pad_Lock.png"/>
                            </StackPanel>
                        </Grid>
                    </local:FZMaterial>
               </local:FZButton>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
                        <Setter TargetName="CountDown" Property="Color" Value="{StaticResource A_Color_White}"/>
                        <Setter TargetName="LockIcon" Property="Color" Value="{StaticResource A_Color_White}"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding LockState}" Value="{x:Static local:LockState.Locked}">
                        <Setter TargetName="LockIcon" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True"/>
                            <Condition Binding="{Binding LockState}" Value="{x:Static local:LockState.Locked}" />
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="ListItemText" Property="local:MultiStringFormatter.Format" Value="{StaticResource A_String_01FormatString}"/>
                        <Setter TargetName="ListItemText" Property="local:MultiStringFormatter.Param0" Value="{Binding Text, ElementName=ListItemText}"/>
                        <Setter TargetName="ListItemText" Property="local:MultiStringFormatter.Param1" Value="Locked"/>
                        <Setter TargetName="ListItemText" Property="local:ScreenReader.Line" Value="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True"/>
                            <Condition Binding="{Binding LockState}" Value="{x:Static local:LockState.Unlocked}" />
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="ListItemText" Property="local:ScreenReader.Line" Value="{Binding Text, ElementName=ListItemText}" />
                    </MultiDataTrigger>                    
                </DataTemplate.Triggers>
            </DataTemplate>

            <!--Seasonal Events Control. Use uppercase because converter used puts all text in uppercase-->
            <Style x:Key="A_Style_FZRun_Popup_BOLD"
                   TargetType="local:FZRun">
                <Setter Property="FontFamily"
                        Value="Horizon_A" />
            </Style>
            <Style x:Key="A_Style_FZRun_Popup_HIGHLIGHT"
                   TargetType="local:FZRun">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_Opaque_Highlight}" />
            </Style>
            <Style x:Key="A_Style_FZRun_Bold" TargetType="local:FZRun">
                <Setter Property="FontFamily" Value="Horizon_C" />
            </Style>
            <Style x:Key="A_Style_FZTextBlock_Description" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonD}">
                <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_SeasonalText" 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="22"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_SeasonalRewardText" 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="22"/>
            </Style>
            
            <ControlTemplate x:Key="A_ControlTemplate_SeasonalEvent">
                <local:FZMaterial Height="95" Color="{StaticResource A_Color_GlassPanel_Interactive}"
                                  Preset="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_InnerAll}">
                    <Grid Margin="6,6">
                        <DockPanel>
                            <local:FZMaterial x:Name="IconBackground" DockPanel.Dock="Left" Width="84" Height="84"
                                              Color="{StaticResource A_Color_SeasonEvent_IncompleteBackground}"
                                              Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}">
                                <local:FZMaterial x:Name="Icon" Color="{StaticResource A_Color_White}"
                                                  ImageSource="{Binding RewardTypeEnum, Converter={StaticResource A_Converter_RewardTypeToIcon}}"/>
                            </local:FZMaterial>
                            <Grid DockPanel.Dock="Right" Margin="6,12,6,10">
                                <local:FZTextBlock x:Name="ObjectiveText" DockPanel.Dock="Top"
                                                   local:TextBlockInlineMarkup.Markup="{Binding EventObjective, Converter={StaticResource A_StringToUpper}}"
                                                   local:TextBlockInlineMarkup.ResourceBaseName="A_Style_FZRun_Popup_"
                                                   VerticalAlignment="Top"
                                                   Style="{StaticResource A_Style_FZTextBlock_SeasonalText}"/>
                                <local:FZMaterial Color="{StaticResource A_Color_White}" Height="1" Width="Auto"
                                                  VerticalAlignment="Center" Margin="0,10"
                                                  Opacity="0.6"/>
                                <local:FZTextBlock x:Name="RewardText" local:TextBlockInlineMarkup.Markup="{Binding EventReward, Converter={StaticResource A_StringToUpper}}" DockPanel.Dock="Bottom"
                                               local:TextBlockInlineMarkup.ResourceBaseName="A_Style_FZRun_Popup_"
                                                   VerticalAlignment="Bottom"
                                               Style="{StaticResource A_Style_FZTextBlock_SeasonalRewardText}"/>
                            </Grid>
                        </DockPanel>
                    </Grid>
                </local:FZMaterial>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding Completed}" Value="True">
                        <Setter TargetName="IconBackground" Property="Color" Value="{StaticResource A_Color_WhitePanel}"/>
                        <Setter TargetName="IconBackground" Property="ImageSource" Value="/ForzaUI;component/Textures/Data_Bound/EventIcons/Gold_Back.png"/>
                        <Setter TargetName="Icon" Property="Color" Value="#B3000000" />
                        <Setter TargetName="ObjectiveText" Property="Opacity" Value="0.5"/>
                        <Setter TargetName="RewardText" Property="Opacity" Value="0.5"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <Style x:Key="A_Style_ItemsControl_RewardList" TargetType="ItemsControl">
                <Setter Property="Tag" Value="Season"/>
                <Setter Property="ItemsSource" Value="{Binding SelectedItem.SlotEventObjectives, ElementName=PART_ItemListBox}"/>
                <Setter Property="ItemTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <ContentControl Template="{StaticResource A_ControlTemplate_SeasonalEvent}" Margin="0,0,0,6"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="Tag" Value="Championship">
                        <Setter Property="ItemsSource" Value="{Binding ChampionshipEventObjectives, RelativeSource={RelativeSource AncestorType=Page}}"/>
                    </Trigger>
                </Style.Triggers>
            </Style>

            <local:MappingConverter x:Key="A_Converter_FestivalSanctioned">
                <local:MappingConverterEntry Key="True" Value="{local:Loc Map.IDS_MapPin_SeasonalChampionship}"/>
                <local:MappingConverterEntry Key="False" Value="{local:Loc EventBlueprint.IDS_SeasonEvent}"/>
            </local:MappingConverter>

        </ResourceDictionary>
    </Page.Resources>

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

    <Grid x:Name="LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualState x:Name="CollapsedDescription" Storyboard="{StaticResource A_Storyboard_Description_Collapsed}"/>
                <VisualState x:Name="OnlineSeasonalChampionship" Storyboard="{StaticResource A_Storyboard_OnlineSeasonalChampionship_Mode}"/>
                <VisualState x:Name="OnlineSeasonalChampionship_Games" Storyboard="{StaticResource A_Storyboard_OnlineSeasonalChampionship_Games_Mode}"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

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

        <local:PlayerBarControl x:Name="TopBar" Style="{StaticResource A_Style_PlayerBarControl}" />
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="DefaultHelpPanel"
                    local:ControllerButtonPanel.ADescription="{local:Loc HelpButtons.IDS_Select}"
                    local:ControllerButtonPanel.BDescription="{local:Loc HelpButtons.IDS_Back}"
                    local:ControllerButtonPanel.YDescription="{Binding SwitchEventMenu, Converter={StaticResource A_Converter_CampaignSwitchEventToSwitchEventString}}"
                    Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}"/>
        </ContentControl>
        <local:NetworkCountdownControl Style="{StaticResource A_Style_NetworkCountdownControl_EventSetup}" />

        <Border Style="{StaticResource A_Style_Border_ScenePadding}"
                ClipToBounds="false">
            <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}"
                  Margin="0,60,0,0"
                  ClipToBounds="false">
                <StackPanel Orientation="Horizontal">

                    <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_2}"  Visibility="{Binding BucketListSetup, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}">
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,18,109" LayoutTransform="{StaticResource A_Transform_FlyerPreviewResize}">
                            <Viewbox Stretch="Uniform">
                                <Control Template="{StaticResource A_ControlTemplate_Control_BucketListFlyer_Internal}" 
                                         DataContext="{Binding BucketListSetup}"
                                         FontSize="{StaticResource A_Double_FlyerRotation_FrontFaceShowing}"/>
                            </Viewbox>
                        </Grid>
                    </Decorator>

                    <StackPanel Margin="-6,0,0,116" VerticalAlignment="Bottom" HorizontalAlignment="Left" ClipToBounds="false">
                        <StackPanel Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}" Visibility="{Binding HideTitleUI, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                            <ContentControl x:Name="ContentControl_SceneTitle" Margin="0,0,0,12"
                                Content="{Binding ScreenTitle, Converter={StaticResource A_StringToUpper}}" 
                                local:BindingProxy.A="{Binding ScreenTitleIcon}"
                                Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                HorizontalAlignment="Left" VerticalAlignment="Top"
                                MaxWidth="642"/>
                        </StackPanel>
                        <StackPanel Margin="0,0,6,5" VerticalAlignment="Top" Visibility="{Binding ShowSeasons, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}">
                            <local:FZMaterial Height="48" Style="{StaticResource A_Style_FZMaterial_FlatPanel_HeaderPanel}" >
                                <local:FZTextBlock x:Name="SeasonObjectivesTitle" Text="{Binding CampaignSetup.IsStreetRaceOnly, Converter={StaticResource A_Converter_FestivalSanctioned}}" Style="{StaticResource A_Style_FZTextBlock_SubHeading}"
                                                   CapHeight="14" HorizontalAlignment="Left" VerticalAlignment="Center"
                                                   Margin="18,0,0,0" Color="{StaticResource A_Color_White}">
                                    
                                </local:FZTextBlock>
                            </local:FZMaterial>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GlassPanel_BodyPanel}">
                                <StackPanel Margin="12,12,12,6">
                                    <ItemsControl x:Name="SeasonObjectives" Style="{StaticResource A_Style_ItemsControl_RewardList}"/>
                                </StackPanel>
                            </local:FZMaterial>
                        </StackPanel>

                        <!--Standard slot menu-->
                        <StackPanel x:Name="SlotMenu" Orientation="Horizontal" local:ZPanel.SortByDepth="True">
                            <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}">
                                <local:CommonListBox x:Name="PART_ItemListBox" ItemsSource="{Binding Items}"
                                                     AllowMouseWheelScrolling="False"
                                                     Style="{StaticResource A_Style_ListBox_CampaignSlotMenu_ItemList}"
                                                     local:FocusOnPageFocusGained.SelectorSelectedItem="True"
                                                     AlternationCount="10000" />
                            </Decorator>
                        </StackPanel>

                        <!--Standard description panel for many screens using this menu-->
                        <local:FZMaterial x:Name="DescriptionPanel" DataContext="{Binding SelectedItem, ElementName=PART_ItemListBox}"
                                    Style="{StaticResource A_Style_FZMaterial_GlassPanel_Pill}"
                                    Height="60" Margin="0,12,6,0" Panel.ZIndex="0">
                            <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding Description}"
                                         Style="{StaticResource A_Style_FZTextBlock_Description}"
                                         HorizontalAlignment="Left"
                                         VerticalAlignment="Center"
                                         Margin="24,14" CapHeight="14"
                                         Color="{StaticResource A_Color_White}"/>
                        </local:FZMaterial>
                    
                         <!--Special description panel for Online Seasonal Championsip screen-->
                        <local:FZMaterial x:Name="OnlineSeasonalEventDescription" Visibility="Collapsed" MaxWidth="642"
                                Style="{StaticResource A_Style_FZMaterial_GlassPanel_Pill}" Height="130" Margin="0,0,6,6" Panel.ZIndex="0">
                            <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding ChampionshipDescription}"
                                         Style="{StaticResource A_Style_FZTextBlock_Description}"
                                         HorizontalAlignment="Left"
                                         VerticalAlignment="Top" TextWrapping="Wrap"
                                         Margin="22" CapHeight="15"
                                         Color="{StaticResource A_Color_White}"/>
                        </local:FZMaterial>
                        
                         <!--Special menu for Championship list-->
                        <Grid x:Name="OnlineSeasonalMenu" Visibility="Collapsed" Margin="0,0,6,-6">
                            <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}">
                                <local:CommonListBox x:Name="CampaignList"
                                                     ItemsSource="{Binding Items}"
                                                     ItemTemplate="{StaticResource A_DataTemplate_ListItem_CampaignItemMenuItem}"
                                                     Style="{StaticResource A_Style_ListBox_TextMenu_Default}"
                                                     ItemContainerStyle="{StaticResource A_Style_ListBoxItem_TextMenu_NotFocusable}"
                                                     local:FocusOnPageFocusGained.SelectorSelectedItem="True"/>
                            </Decorator>
                        </Grid>
                    </StackPanel>

                    <Decorator Visibility="{Binding ShowSeasons, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}">
                          <ContentControl x:Name="PART_Flyer"
                                          DataContext="{Binding CampaignSetup}" VerticalAlignment="Bottom"
                                          Style="{StaticResource A_Style_Control_CampaignFlyer}" Margin="18,0,0,111"
                                          LayoutTransform="{StaticResource A_Transform_FlyerPreviewResize}" />
                    </Decorator>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</Page>
