<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:ForzaUI"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Style="{StaticResource A_Style_Page_Generic}"
      mc:Ignorable="d"
      x:Class="ForzaUI.Scenes.Anthem.A_ForzaEventsShop">

    <Page.Resources>
        <Color x:Key="A_Color_ForzaEvents_InnerItemText">#FFFFFFFF</Color>

        <System:Double x:Key="A_Double_ForzaEvents_ItemWidth">427</System:Double>
        <System:Double x:Key="A_Double_ForzaEvents_GenericItemHeight">356</System:Double>

        <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_ForzaEventsShopItemGradientBackground"
                                           GradientColorA="#FF999999"
                                           GradientColorB="#FFFFFFFF"
                                           GradientAngle="0"
                                           BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}" />

        <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangleStroke_ForzathonItem_RarityStroke"
                                             CornerRadius="4"
                                             Thickness="6,90,6,6" />

        <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangleStroke_ForzathonItem_RarityStroke_HorizonEdition"
                                             BasedOn="{StaticResource A_FZMaterialPresetRoundtangleStroke_ForzathonItem_RarityStroke}"
                                             GradientColorA="{StaticResource A_Color_HorizonEditionGradientA}"
                                             GradientColorB="{StaticResource A_Color_HorizonEditionGradientB}"
                                             GradientAngle="45"/>

        <local:MappingConverter x:Key="A_Converter_RarityToPreset" Default="{StaticResource A_FZMaterialPresetRoundtangleStroke_ForzathonItem_RarityStroke}">
            <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.HorizonEdition}" Value="{StaticResource A_FZMaterialPresetRoundtangleStroke_ForzathonItem_RarityStroke_HorizonEdition}" />
        </local:MappingConverter>

        <CornerRadius x:Key="A_CornerRadius_ForzaEvents_StatePill">20</CornerRadius>

        <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_FP_Pill"
                                           BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
                                           CornerRadius="{StaticResource A_CornerRadius_ForzaEvents_StatePill}" />

        <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_Owned_Pill"
                                           BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight}"
                                           CornerRadius="{StaticResource A_CornerRadius_ForzaEvents_StatePill}" />

        <Style x:Key="A_Style_FZMaterial_ForzaEvents_ItemPill"
               TargetType="{x:Type local:FZMaterial}">
            <Setter Property="VerticalAlignment" Value="Bottom" />
            <Setter Property="Margin" Value="18,0,0,93" />
            <Setter Property="Height" Value="40" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_ForzaEvents_ItemPill"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="CapHeight" Value="23" />
            <Setter Property="Margin" Value="22,0,11,0" />
            <Setter Property="Stretch" Value="None" />
            <Setter Property="Color" Value="#FFFFFF" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <Style x:Key="A_Style_FZMaterial_ForzaEventsShopItemBackground"
               TargetType="local:FZMaterial">
            <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}" />
            <Setter Property="Color" Value="#FFFFFF" />
        </Style>

        <Style x:Key="A_Style_FZMaterial_ForzaEventsShopItemGradientBackground"
               TargetType="local:FZMaterial">
            <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_ForzaEventsShopItemGradientBackground}" />
        </Style>

        <local:MappingConverter x:Key="A_Converter_ForzaEventsShopItemPurchaseStateToTitle">
            <local:MappingConverterEntry Key="{x:Static local:ForzaEventShopItemPurchaseState.UnPurchased}" Value="{local:Loc ForzaEvents.IDS_PurchaseNow}" />
            <local:MappingConverterEntry Key="{x:Static local:ForzaEventShopItemPurchaseState.PurchasedConsumed}" Value="{local:Loc ForzaEvents.IDS_RewardOwned}" />
            <local:MappingConverterEntry Key="{x:Static local:ForzaEventShopItemPurchaseState.PurchasedAvailable}" Value="{local:Loc ForzaEvents.IDS_PurchaseAgain}" />
        </local:MappingConverter>

        <Style x:Key="A_Style_FZTextBlock_ItemPurchaseStateTitle"
               TargetType="local:FZTextBlock"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="Color" Value="{StaticResource A_Color_ForzaEvents_ItemTitle}" />
            <Setter Property="CapHeight" Value="24" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_ItemPuchaseStateDescription"
               TargetType="local:FZTextBlock"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
            <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_Markup_" />
            <Setter Property="Color" Value="{StaticResource A_Color_ForzaEvents_ItemDescription}" />
            <Setter Property="CapHeight" Value="17" />
            <Setter Property="Margin" Value="0,10,0,0" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <System:Double x:Key="A_Double_InnerItemTitle_CapHeight">28</System:Double>
        <System:Double x:Key="A_Double_InnerItemTitle_CapHeight_CHS">25</System:Double>
        <System:Double x:Key="A_Double_InnerItemTitle_CapHeight_CHT">25</System:Double>
        <System:Double x:Key="A_Double_InnerItemTitle_CapHeight_JP">25</System:Double>
        <System:Double x:Key="A_Double_InnerItemTitle_CapHeight_KO">25</System:Double>
        <Style x:Key="A_Style_FZTextBlock_InnerItemTitle"
               TargetType="local:FZTextBlock"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="Color" Value="{StaticResource A_Color_ForzaEvents_InnerItemText}" />
            <Setter Property="CapHeight" Value="{local:LocalizedResource A_Double_InnerItemTitle_CapHeight}" />
            <Setter Property="HorizontalAlignment" Value="Right" />
            <Setter Property="TextWrapping" Value="Wrap" />
            <Setter Property="TextAlignment" Value="Right" />
            <Setter Property="Effect" Value="{StaticResource A_Effect_HighContrastModeDropShadow}" />
        </Style>

        <System:Double x:Key="A_Double_InnerItemDescription_CapHeight">27</System:Double>
        <System:Double x:Key="A_Double_InnerItemDescription_CapHeight_CHS">24</System:Double>
        <System:Double x:Key="A_Double_InnerItemDescription_CapHeight_CHT">24</System:Double>
        <System:Double x:Key="A_Double_InnerItemDescription_CapHeight_JP">24</System:Double>
        <System:Double x:Key="A_Double_InnerItemDescription_CapHeight_KO">24</System:Double>
        
        <Style x:Key="A_Style_FZTextBlock_InnerItemDescription"
               TargetType="local:FZTextBlock"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
            <Setter Property="Color" Value="{StaticResource A_Color_ForzaEvents_InnerItemText}" />
            <Setter Property="CapHeight" Value="{local:LocalizedResource A_Double_InnerItemDescription_CapHeight}" />
            <Setter Property="HorizontalAlignment" Value="Right" />
            <Setter Property="TextWrapping" Value="Wrap" />
            <Setter Property="TextAlignment" Value="Right" />
            <Setter Property="Effect" Value="{StaticResource A_Effect_HighContrastModeDropShadow}" />
        </Style>

        <Style x:Key="A_Style_FZMaterial_ItemContents_SoftShadow"
               TargetType="local:FZMaterial"
               BasedOn="{StaticResource A_Style_FZMaterial_ShadowBase_ForSubgraph}">
            <Setter Property="Opacity"
                    Value="0.6" />
            <Setter Property="Margin"
                    Value="-10" />
            <Setter Property="Preset">
                <Setter.Value>
                    <local:FZMaterialPresetRoundtangle Softness="35" CornerRadius="20" AlphaMode="MultiplyInvColorOnly" Unlit="True" />
                </Setter.Value>
            </Setter>
        </Style>

        <local:MappingConverter x:Key="A_Converter_VisibleInPurchasedState"
                                Default="{x:Static Visibility.Visible}">
            <local:MappingConverterEntry Key="{x:Static local:ForzaEventShopItemPurchaseState.UnPurchased}" Value="{x:Static Visibility.Collapsed}" />
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_Converter_CollapsedInConsumedPurchaseState"
                                Default="{x:Static Visibility.Visible}">
            <local:MappingConverterEntry Key="{x:Static local:ForzaEventShopItemPurchaseState.PurchasedConsumed}" Value="{x:Static Visibility.Collapsed}" />
        </local:MappingConverter>

        <System:Boolean x:Key="A_Boolean_False">False</System:Boolean>

        <Style x:Key="A_Style_FZRun_Markup_FP"
               TargetType="{x:Type local:FZRun}">
            <Setter Property="FontFamily"
                    Value="Horizon_A" />
            <Setter Property="Color"
                    Value="{StaticResource A_Color_ForzaEvents_CostBackground}" />
        </Style>

        <local:MappingConverter x:Key="A_Converter_RewardTypeToFormatString"
                                Default="{local:Loc ForzaEvents.IDS_ForzaEventsShop_RewardItemTypeFormat}">
            <local:MappingConverterEntry Key="{x:Static local:UIRewardType.SuperWheelspin}" Value="{local:Loc ForzaEvents.IDS_ForzaEventsShop_RewardItemTypeFormat_NoRarity}" />
        </local:MappingConverter>

        <ControlTemplate x:Key="A_ControlTemplate_ForzaEventsShopItemWithContent"
                         TargetType="{x:Type ContentControl}">
            <DockPanel>
                <Decorator Height="93"
                           DockPanel.Dock="Bottom">
                    <StackPanel HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Margin="20,0,20,0">
                        <local:FZTextBlock local:MultiStringFormatter.Format="{Binding RewardType, Converter={StaticResource A_Converter_RewardTypeToFormatString}}"
                                           local:MultiStringFormatter.Param0="{Binding Rarity, Converter={StaticResource A_Converter_RarityToNameString}}"
                                           local:MultiStringFormatter.Param1="{Binding RewardType, Converter={StaticResource A_Converter_RewardTypeToString}}"
                                           Text="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"
                                           Style="{StaticResource A_Style_FZTextBlock_ItemPurchaseStateTitle}" />
                        <local:FZTextBlock local:BindingProxy.A="{Binding PurchaseState, Converter={StaticResource A_Converter_ForzaEventsShopItemPurchaseStateToTitle}}"
                                           local:TextBlockInlineMarkup.Markup="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource Self}}"
                                           Style="{StaticResource A_Style_FZTextBlock_ItemPuchaseStateDescription}" />
                    </StackPanel>
                </Decorator>
                <Grid>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_ForzaEventsShopItemGradientBackground}"
                                      Margin="4,4,4,0">
                        <ContentPresenter />
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FloatingIconShadow}"
                                      Margin="0,0,0,-108">
                        <Grid>
                            <Decorator Visibility="{Binding PurchaseState, Converter={StaticResource A_Converter_CollapsedInConsumedPurchaseState}}">
                                <local:FZMaterial Color="{StaticResource A_Color_ForzaEvents_CostBackground}"
                                                  Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_FP_Pill}"
                                                  HorizontalAlignment="Left"
                                                  Style="{StaticResource A_Style_FZMaterial_ForzaEvents_ItemPill}">
                                    <DockPanel>
                                        <local:FZMaterial DockPanel.Dock="Right"
                                                          ImageSource="/ForzaUI;component/Textures/Data_Bound/Forza_Events/FPIcon/ForzaEventPoints_Small_Shop.png"
                                                          Width="31"
                                                          Height="31"
                                                          Margin="4" />
                                        <local:FZTextBlock Text="{Binding Cost}"
                                                           Style="{StaticResource A_Style_FZTextBlock_ForzaEvents_ItemPill}" />
                                    </DockPanel>
                                </local:FZMaterial>
                            </Decorator>
                            <Decorator Margin="0,0,16,0"
                                       Visibility="{Binding PurchaseState, Converter={StaticResource A_Converter_VisibleInPurchasedState}}">
                                <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_Owned_Pill}"
                                                  HorizontalAlignment="Right"
                                                  Style="{StaticResource A_Style_FZMaterial_ForzaEvents_ItemPill}">
                                    <local:FZTextBlock Text="{Binding Source={local:Loc ForzaEvents.IDS_Owned}, Converter={StaticResource A_StringToUpper}}"
                                                       Style="{StaticResource A_Style_FZTextBlock_ForzaEvents_ItemPill}"
                                                       CapHeight="19"
                                                       Margin="16,9" />
                                </local:FZMaterial>
                            </Decorator>
                        </Grid>
                    </local:FZMaterial>
                </Grid>
            </DockPanel>
        </ControlTemplate>

        <Style x:Key="A_Style_Control_ForzaEventsShopItemWithContent"
               TargetType="{x:Type ContentControl}">
            <Setter Property="Template" Value="{StaticResource A_ControlTemplate_ForzaEventsShopItemWithContent}" />
            <Setter Property="Focusable" Value="False" />
            <Setter Property="IsHitTestVisible" Value="False" />
        </Style>

        <DataTemplate DataType="{x:Type local:ForzaEventsYourPointsShopItem}">
            <Control Template="{StaticResource A_ControlTemplate_ForzaEvents_ForzaEventPointTotal}"
                     Height="67"
                     local:AncestorPropertySetter.Type="{x:Type ListBoxItem}"
                     local:AncestorPropertySetter.Property="IsEnabled"
                     local:AncestorPropertySetter.Value="{StaticResource A_Boolean_False}" />
        </DataTemplate>

        <System:Double x:Key="A_Double_ShopTitle_Separator">8</System:Double>
        <System:Double x:Key="A_Double_ShopTitle_Separator_CHS">14</System:Double>
        <System:Double x:Key="A_Double_ShopTitle_Separator_CHT">14</System:Double>
        <System:Double x:Key="A_Double_ShopTitle_Separator_JP">14</System:Double>
        <System:Double x:Key="A_Double_ShopTitle_Separator_KO">14</System:Double>

        <DataTemplate DataType="{x:Type local:ForzaEventsPlayerCustomizationShopItem}">
            <ContentControl Style="{StaticResource A_Style_Control_ForzaEventsShopItemWithContent}"
                            Width="{StaticResource A_Double_ForzaEvents_ItemWidth}"
                            Height="{StaticResource A_Double_ForzaEvents_GenericItemHeight}">
                <local:FZMaterial Preset="{Binding Rarity, Converter={StaticResource A_Converter_RarityToPreset}}" Color="{Binding Rarity, Converter={StaticResource A_Converter_RarityToColor}}">
                    <Grid Margin="6">
                        <local:FZMaterial ImageSource="{Binding Image}" Stretch="Uniform" HorizontalAlignment="Left" Width="245" Height="245"/>
                        <StackPanel HorizontalAlignment="Right" 
                                VerticalAlignment="Top"
                                Margin="6,8">
                            <local:FZTextBlock Text="{Binding Title, Converter={StaticResource A_StringToUpper}}"
                                           Style="{StaticResource A_Style_FZTextBlock_InnerItemTitle}" 
                                           TextWrapping="NoWrap"/>
                            <Decorator Height="{local:LocalizedResource A_Double_ShopTitle_Separator}"/>
                            <local:FZTextBlock Text="{Binding Description, Converter={StaticResource A_StringToUpper}}"
                                           Style="{StaticResource A_Style_FZTextBlock_InnerItemDescription}" 
                                           MaxWidth="200"
                                           TextWrapping="NoWrap"/>
                        </StackPanel>
                    </Grid>
                </local:FZMaterial>
            </ContentControl>
        </DataTemplate>

        <DataTemplate DataType="{x:Type local:ForzaEventsEmoteShopItem}">
            <ContentControl Style="{StaticResource A_Style_Control_ForzaEventsShopItemWithContent}"
                            Width="{StaticResource A_Double_ForzaEvents_ItemWidth}"
                            Height="{StaticResource A_Double_ForzaEvents_GenericItemHeight}">
                <local:FZMaterial Preset="{Binding Rarity, Converter={StaticResource A_Converter_RarityToPreset}}" Color="{Binding Rarity, Converter={StaticResource A_Converter_RarityToColor}}">
                    <Grid Margin="6">
                        <local:FZMaterial ImageSource="{Binding Image}" Stretch="Uniform" HorizontalAlignment="Left" Width="245" Height="245"/>
                        <StackPanel HorizontalAlignment="Right" 
                                VerticalAlignment="Top"
                                Margin="6,8">
                            <local:FZTextBlock Text="{Binding Title, Converter={StaticResource A_StringToUpper}}"
                                           Style="{StaticResource A_Style_FZTextBlock_InnerItemTitle}" 
                                           TextWrapping="NoWrap"/>
                            <Decorator Height="{local:LocalizedResource A_Double_ShopTitle_Separator}"/>
                            <local:FZTextBlock Text="{Binding Description, Converter={StaticResource A_StringToUpper}}"
                                           Style="{StaticResource A_Style_FZTextBlock_InnerItemDescription}" 
                                           MaxWidth="200"
                                           TextWrapping="NoWrap"/>
                        </StackPanel>
                    </Grid>
                </local:FZMaterial>
            </ContentControl>
        </DataTemplate>

        <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangleStroke_FlatPanel_HornOutline"
            BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
            Thickness="6"
            CornerRadius="15"/>

        <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_HornColor"
            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
            CornerRadius="10"/>

        <DataTemplate DataType="{x:Type local:ForzaEventsHornShopItem}">
            <ContentControl Style="{StaticResource A_Style_Control_ForzaEventsShopItemWithContent}"
                            Width="{StaticResource A_Double_ForzaEvents_ItemWidth}"
                            Height="{StaticResource A_Double_ForzaEvents_GenericItemHeight}">
                <local:FZMaterial Preset="{Binding Rarity, Converter={StaticResource A_Converter_RarityToPreset}}" Color="{Binding Rarity, Converter={StaticResource A_Converter_RarityToColor}}">
                    <Grid Margin="6">
                        <Grid Height="165"
                              Width="165"
                              Margin="35"
                              HorizontalAlignment="Left"
                              VerticalAlignment="Center">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_ItemContents_SoftShadow}"/>
                            <local:FZMaterial Color="#FFFFFFFF"
                                              Preset="{StaticResource A_FZMaterialPresetRoundtangleStroke_FlatPanel_HornOutline}"
                                              Height="150"
                                              Width="150" />
                            <local:FZMaterial Color="{Binding Rarity, Converter={StaticResource A_Converter_RarityToColor}}"
                                              Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_HornColor}"
                                              Height="140"
                                              Width="140"/>
                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Forza_Events/Horn_Reward.png"
                                              Height="140"
                                              Width="140"
                                              HorizontalAlignment="Center"
                                              VerticalAlignment="Center"/>
                        </Grid>
                        <StackPanel HorizontalAlignment="Right" 
                                VerticalAlignment="Top"
                                Margin="6,8">
                            <local:FZTextBlock Text="{Binding Title, Converter={StaticResource A_StringToUpper}}"
                                           Style="{StaticResource A_Style_FZTextBlock_InnerItemTitle}"
                                           TextWrapping="NoWrap"/>
                            <Decorator Height="{local:LocalizedResource A_Double_ShopTitle_Separator}"/>
                            <local:FZTextBlock Text="{Binding Description, Converter={StaticResource A_StringToUpper}}"
                                           Style="{StaticResource A_Style_FZTextBlock_InnerItemDescription}"
                                           MaxWidth="200"
                                           TextWrapping="NoWrap"/>
                        </StackPanel>
                    </Grid>
                </local:FZMaterial>
            </ContentControl>
        </DataTemplate>

        <DataTemplate DataType="{x:Type local:ForzaEventsSuperWheelspinShopItem}">
            <ContentControl Style="{StaticResource A_Style_Control_ForzaEventsShopItemWithContent}"
                            Width="{StaticResource A_Double_ForzaEvents_ItemWidth}"
                            Height="{StaticResource A_Double_ForzaEvents_GenericItemHeight}">
                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Forza_Events/Super_Wheelspin_Shop.png"
                                  Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}"/>
            </ContentControl>
        </DataTemplate>

        <DataTemplate DataType="{x:Type local:ForzaEventsWheelspinShopItem}">
            <DockPanel Height="115"
                       Width="427"
                       IsHitTestVisible="False">
                <local:FZMaterial DockPanel.Dock="Left"
                                  ImageSource="/ForzaUI;component/Textures/Data_Bound/Forza_Events/Wheelspin_Shop.png"
                                  Width="216"
                                  Height="114" />
                <StackPanel DockPanel.Dock="Left"
                            Margin="-95,0,20,0"
                            VerticalAlignment="Center">
                    <local:FZTextBlock Text="{Binding Source={local:Loc ForzaEvents.IDS_PurchaseWheelspin}, Converter={StaticResource A_StringToUpper}}"
                                       Style="{StaticResource A_Style_FZTextBlock_ItemPurchaseStateTitle}"
                                       HorizontalAlignment="Left" />
                    <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding PurchaseStateDescription}"
                                       Style="{StaticResource A_Style_FZTextBlock_ItemPuchaseStateDescription}"
                                       HorizontalAlignment="Left" />
                </StackPanel>
            </DockPanel>
        </DataTemplate>

        <DataTemplate DataType="{x:Type local:ForzaEventsFeaturedCarShopItem}">
            <ContentControl Style="{StaticResource A_Style_Control_ForzaEventsShopItemWithContent}"
                            Width="427"
                            Height="524">
                <local:FZMaterial Preset="{Binding Rarity, Converter={StaticResource A_Converter_RarityToPreset}}" Color="{Binding Rarity, Converter={StaticResource A_Converter_RarityToColor}}">
                    <Grid ClipToBounds="True" Margin="6">
                        <Control Template="{StaticResource A_ControlTemplate_ForzaEvents_CarInformation}" Margin="6,8"/>
                        <local:FZMaterial ImageSource="{Binding CarThumbnail}"
                                      Stretch="UniformToFill"
                                      Margin="-150,50,0,85"
                                      Width="600"
                                      Height="337.5"/>
                    </Grid>
                </local:FZMaterial>
            </ContentControl>
        </DataTemplate>

        <DataTemplate DataType="{x:Type local:ForzaEventsCarShopItem}">
            <ContentControl Style="{StaticResource A_Style_Control_ForzaEventsShopItemWithContent}"
                            Width="{StaticResource A_Double_ForzaEvents_ItemWidth}"
                            Height="{StaticResource A_Double_ForzaEvents_GenericItemHeight}">
                <local:FZMaterial Preset="{Binding Rarity, Converter={StaticResource A_Converter_RarityToPreset}}" Color="{Binding Rarity, Converter={StaticResource A_Converter_RarityToColor}}">
                    <Grid ClipToBounds="True" Margin="6">
                        <Control Template="{StaticResource A_ControlTemplate_ForzaEvents_CarInformation}" Margin="6,8"/>
                        <local:FZMaterial ImageSource="{Binding CarThumbnail}"
                                          Stretch="UniformToFill"
                                          Margin="0,25,0,0"
                                          Width="400"
                                          Height="225"/>
                    </Grid>
                </local:FZMaterial>
            </ContentControl>
        </DataTemplate>

        <ControlTemplate x:Key="A_ControlTemplate_CommonListBox_ForzaEventsShopTemplate"
                         TargetType="{x:Type local:CommonListBox}">
            <WrapPanel Orientation="Vertical" IsItemsHost="True"/>
        </ControlTemplate>

        <Style x:Key="A_Style_ListBoxItem_ForzaEventsShopItem"
               BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_Default}"
               TargetType="{x:Type ListBoxItem}">
            <Style.Resources>
                <Style x:Key="A_Style_FrameworkElement_TextMenuItemContainer_Dynamic"
                       TargetType="{x:Type FrameworkElement}" />
            </Style.Resources>
            <Setter Property="Template"
                    Value="{StaticResource A_ControlTemplate_TextMenu_HighlightStroke}" />
            <Setter Property="Margin"
                    Value="0,0,5,5" />
        </Style>

        <local:MappingConverter x:Key="A_Converter_SeasonToTitle"
                                Default="{local:Loc ForzaEvents.IDS_ForzaEvents_ShopTitle_Any}">
            <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="{local:Loc ForzaEvents.IDS_ForzaEvents_ShopTitle_Spring}" />
            <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="{local:Loc ForzaEvents.IDS_ForzaEvents_ShopTitle_Summer}" />
            <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="{local:Loc ForzaEvents.IDS_ForzaEvents_ShopTitle_Autumn}" />
            <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="{local:Loc ForzaEvents.IDS_ForzaEvents_ShopTitle_Winter}" />
        </local:MappingConverter>

        <Style x:Key="A_FZTextBlock_TimeRemaining"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
            <Setter Property="Color" Value="#FFFFFF" />
            <Setter Property="CapHeight" Value="17" />
            <Setter Property="TextAlignment" Value="Right" />
        </Style>

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

    </Page.Resources>

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

    <Grid>
        <!-- Background Blur -->
       <Control Style="{StaticResource A_Style_Control_ScreenBackground}" />

        <local:PlayerBarControl Style="{StaticResource A_Style_PlayerBarControl}" />

        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <local:ControllerButtonPanel x:Name="HelpPanel" HorizontalAlignment="Left" VerticalAlignment="Bottom" Background="{x:Null}">
                <local:ControllerButtonControl Button="A" Description="{local:Loc HelpButtons.IDS_Select}" />
                <local:ControllerButtonControl Button="B" Description="{local:Loc HelpButtons.IDS_Back}" />
                <local:ControllerButtonControl Button="X" Description="{Binding SelectedItem.PreviewDescription}" />
            </local:ControllerButtonPanel>
        </ContentControl>

        <Border Style="{StaticResource A_Style_Border_ScenePadding}" Visibility="{Binding HasLoadedShopData, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
            <StackPanel VerticalAlignment="Center"
                        HorizontalAlignment="Center"
                        Margin="0,0,0,49">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                    <ContentControl local:BindingProxy.B="{Binding CurrentSeason, Converter={StaticResource A_Converter_SeasonToTitle}}"
                                    Content="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource Self}, Converter={StaticResource A_StringToUpper}}"
                                    Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}" 
                                    local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/ForzaEvents_Shop.png"
                                    HorizontalAlignment="Left"/>
                    <local:FZMaterial HorizontalAlignment="Right"
                                      Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
                                      Color="{StaticResource A_Color_ForzaEvents_TimeRemainingBackground}"
                                      MinWidth="260"
                                      Margin="0,0,5,12"
                                      Height="68">
                        <Grid>
                            <StackPanel HorizontalAlignment="Right" Margin="24,10">
                                <local:FZTextBlock Text="{Binding Source={local:Loc ForzaEvents.IDS_TimeRemaining}, Converter={StaticResource A_StringToUpper}}"
                                               Style="{StaticResource A_FZTextBlock_TimeRemaining}"
                                               Margin="0,0,0,6" />
                                <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding TimeRemaining}"
                                               local:TextBlockInlineMarkup.ResourceBaseName="A_Style_FZRun_ForzaEvents_ShopTimeRemaining_"
                                               Style="{StaticResource A_FZTextBlock_TimeRemaining}"
                                               CapHeight="19" />
                            </StackPanel>
                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Forza_Events/FTShop_Clock.png" Width="104" Height="68" HorizontalAlignment="Left"/>
                        </Grid>

                    </local:FZMaterial>
                </Grid>

                <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}">
                    <local:CommonListBox ItemsSource="{Binding Collection}"
                                         SelectedItem="{Binding SelectedItem}"
                                         MaxHeight="722"
                                         Template="{StaticResource A_ControlTemplate_CommonListBox_ForzaEventsShopTemplate}"
                                         ItemContainerStyle="{StaticResource A_Style_ListBoxItem_ForzaEventsShopItem}"
                                         FocusVisualStyle="{x:Null}"
                                         local:FocusOnPageFocusGained.SelectorSelectedItem="True"
                                         AllowSelectionOfDisabledItems="False">
                        <local:CommonListBox.Resources>
                            <Style x:Key="A_Style_FZMaterial_TextMenuItemShadow"
                               TargetType="{x:Type local:FZMaterial}"
                               BasedOn="{StaticResource A_Style_FZMaterial_TextMenuItemShadow}">
                                <Setter Property="Margin" Value="-25" />
                                <Setter Property="Preset">
                                    <Setter.Value>
                                        <local:FZMaterialPresetSelfShadow Softness="25" CornerRadius="30" />
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </local:CommonListBox.Resources>
                    </local:CommonListBox>
                </Decorator>
            </StackPanel>
        </Border>
    </Grid>
</Page>
