<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_RareCarDealershipShop">

    <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:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_RareCarShopGradientBackground"
                                           GradientColorA="{StaticResource A_Color_RareCarDealership_GradientA}"
                                           GradientColorB="{StaticResource A_Color_RareCarDealership_GradientB}"
                                           GradientAngle="90"
                                           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}"
                                           GradientColorA="{StaticResource A_Color_RareCarDealership_GradientA}"
                                           GradientColorB="{StaticResource A_Color_RareCarDealership_GradientB}"
                                           GradientAngle="90"/>

        <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_FZMaterial_Rare_Car_ItemTickets"
               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_FrameworkElement_OwnedPill"
               TargetType="{x:Type FrameworkElement}">
            <Setter Property="Visibility" Value="Collapsed" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding PurchaseState}" Value="{x:Static local:RareCarDealershipItemPurchaseState.PurchasedAvailable}">
                    <Setter Property="Visibility" Value="Visible" />
                </DataTrigger>
                <DataTrigger Binding="{Binding PurchaseState}" Value="{x:Static local:RareCarDealershipItemPurchaseState.PurchasedConsumed}">
                    <Setter Property="Visibility" Value="Visible" />
                </DataTrigger>
                <DataTrigger Binding="{Binding LimitedStockState}" Value="{x:Static local:RareCarDealershipItemLimitedStockState.LimitedSoldOut}">
                    <Setter Property="Visibility" Value="Visible" />
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="A_Style_FZTextBlock_Rare_Car_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="#42210B" />
            <Setter Property="Opacity" Value="1.0" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_Rare_Car_PurchaseStateItemPill"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_Rare_Car_ItemPill}">
            <Setter Property="Color" Value="#FFFFFF" />
        </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>

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

        <local:MappingConverter x:Key="A_Converter_ForzaEventsShopItemPurchaseStateToTitle">
            <local:MappingConverterEntry Key="{x:Static local:RareCarDealershipItemPurchaseState.UnPurchased}" Value="{local:Loc ForzaEvents.IDS_PurchaseNow}" />
            <local:MappingConverterEntry Key="{x:Static local:RareCarDealershipItemPurchaseState.PurchasedConsumed}" Value="{local:Loc ForzaEvents.IDS_RewardOwned}" />
            <local:MappingConverterEntry Key="{x:Static local:RareCarDealershipItemPurchaseState.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_HorizonA}">
            <Setter Property="local:TextBlockInlineMarkup.Markup"
                    Value="{Binding PurchaseState, Converter={StaticResource A_Converter_ForzaEventsShopItemPurchaseStateToTitle}}" />
            <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_Markup_" />
            <Setter Property="Color" Value="{StaticResource A_Color_ForzaEvents_ItemDescription}" />
            <Setter Property="CapHeight" Value="16" />
            <Setter Property="Margin" Value="0,10,0,0" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding LimitedStockState}"
                             Value="{x:Static local:RareCarDealershipItemLimitedStockState.LimitedItemsRemaining}">
                    <Setter Property="local:TextBlockInlineMarkup.Markup"
                            Value="{Binding PurchaseStateDescription}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding LimitedStockState}"
                             Value="{x:Static local:RareCarDealershipItemLimitedStockState.LimitedSoldOut}">
                    <Setter Property="local:TextBlockInlineMarkup.Markup"
                            Value="{Binding PurchaseStateDescription}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="A_Style_FZTextBlock_TicketPurchaseDescription"
               TargetType="local:FZTextBlock"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{local:Loc Lobby.IDS_RareCarDealershipShop_PurchasePasses}" />
            <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_Markup_" />
            <Setter Property="Color" Value="{StaticResource A_Color_Tile_Title_RareCarDealership}" />
            <Setter Property="CapHeight" Value="18" />
            <Setter Property="Margin" Value="0,10,0,0" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_VoteTileTitle"
                 TargetType="local:FZTextBlock"
                 BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{local:Loc Lobby.IDS_RareCarDealership_VoteTile_Title}" />
            <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_Markup_" />
            <Setter Property="Color" Value="{StaticResource A_Color_Tile_Title_RareCarDealership}" />
            <Setter Property="CapHeight" Value="24" />
            <Setter Property="Margin" Value="0,10,0,0" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_VoteTileDescription"
                 TargetType="local:FZTextBlock"
                 BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="Color" Value="{StaticResource A_Color_ForzaEvents_ItemDescription}" />
            <Setter Property="CapHeight" Value="16" />
            <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:RareCarDealershipItemPurchaseState.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:RareCarDealershipItemPurchaseState.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:MappingConverterEntry Key="{x:Static local:UIRewardType.QuickChatPhrase}" Value="{local:Loc ForzaEvents.IDS_ForzaEventsShop_RewardItemTypeFormat_NoRarity}" />
        </local:MappingConverter>

        <ControlTemplate x:Key="A_ControlTemplate_ForzaEventsShopItemWithContent"
                         TargetType="{x:Type ContentControl}">
            <DockPanel>
                <Decorator Height="50"
                           DockPanel.Dock="Bottom">
                    <StackPanel HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Margin="20,0,20,10">
                        
                        <local:FZTextBlock 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 Margin="0,0,16,0"
                                       Style="{StaticResource A_Style_FrameworkElement_OwnedPill}">
                                <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_Rare_Car_PurchaseStateItemPill}"
                                                       CapHeight="19"
                                                       Margin="16,9" />
                                </local:FZMaterial>
                            </Decorator>
                        </Grid>
                    </local:FZMaterial>
                </Grid>
            </DockPanel>
        </ControlTemplate>

        <ControlTemplate x:Key="A_ControlTemplate_ForzaEventsShopItem"
                         TargetType="{x:Type ContentControl}">
            <DockPanel>
                <Decorator Height="50"
                           DockPanel.Dock="Bottom">
                    <StackPanel HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Margin="20,0,20,10">
                        
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TicketPurchaseDescription}" />
                    </StackPanel>
                </Decorator>
                <Grid>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_RareCarShopGradientBackground}"
                                      Margin="4,4,4,0">
                        <ContentPresenter />
                    </local:FZMaterial>
                </Grid>
            </DockPanel>
        </ControlTemplate>

        <ControlTemplate x:Key="A_ControlTemplate_RareCarDealershipShopItemVote"
                            TargetType="{x:Type ContentControl}">
            <DockPanel>
                <Decorator Height="100"
                            DockPanel.Dock="Bottom">
                    <StackPanel HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Margin="20,0,20,10">

                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_VoteTileTitle}" />
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_VoteTileDescription}" local:TextBlockInlineMarkup.Markup="{Binding VoteTimeRemainingString}" local:TextBlockInlineMarkup.ResourceBaseName="A_Style_FZRun_Markup_"/>
                    </StackPanel>
                </Decorator>
                <Grid>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_RareCarShopGradientBackground}"
                                      Margin="4,4,4,0">
                        <ContentPresenter />
                    </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>

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

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

        <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>

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

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

        <DataTemplate DataType="{x:Type local:RareCarDealershipTicketsShopItem}">
            <ContentControl Style="{StaticResource A_Style_Control_ForzaEventsShopItem}"
                            Width="427"
                            Height="178">
                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Rare_Car_Dealership/PurchaseTickets.png" Width="420" Height="120" HorizontalAlignment="Center"/>
            </ContentControl>
        </DataTemplate>

        <DataTemplate DataType="{x:Type local:RareCarDealershipVoteShopItem}">
            <ContentControl Style="{StaticResource A_Style_Control_RareCarDealershipShopItemVote}"
                            Width="427"
                            Height="722">
                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Rare_Car_Dealership/VotingTile_BG.png" Width="420" Height="628" HorizontalAlignment="Center">
                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Rare_Car_Dealership/VotingTile_Frame.png" Stretch="UniformToFill">
                        <DockPanel LastChildFill="False">
                            <local:FZMaterial ImageSource="{Binding CarAThumbnail}" Width="400" Height="225" DockPanel.Dock="Top" Margin="0,20,0,0"/>
                            <local:FZMaterial ImageSource="{Binding CarBThumbnail}" Width="400" Height="225" DockPanel.Dock="Bottom" Margin="0,0,0,20"/>
                        </DockPanel>
                    </local:FZMaterial>
                </local:FZMaterial>
            </ContentControl>
        </DataTemplate>

        <DataTemplate DataType="{x:Type local:RareCarDealershipDummyShopItem}">
            <ContentControl Template="{StaticResource A_Template_Control_Carousel_EmptyItemStyle}"
                            Width="{StaticResource A_Double_ForzaEvents_ItemWidth}"
                            Height="{StaticResource A_Double_ForzaEvents_GenericItemHeight}"
                            local:AncestorPropertySetter.Type="{x:Type ListBoxItem}"
                            local:AncestorPropertySetter.Property="IsEnabled"
                            local:AncestorPropertySetter.Value="{StaticResource A_Boolean_False}" />
        </DataTemplate>

        <DataTemplate DataType="{x:Type local:RareCarDealershipFeaturedCarShopItem}">
            <ContentControl Style="{StaticResource A_Style_Control_ForzaEventsShopItemWithContent}"
                            Width="427"
                            Height="534">
                <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:RareCarDealershipCarShopItem}">
            <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}">
            <local:FZScrollViewer Style="{StaticResource A_Style_FZScrollViewer_Default_Horizontal}"
                                  CanContentScroll="True"
                                  Margin="10,0"
                                  VerticalScrollBarVisibility="Disabled"
                                  HorizontalScrollBarVisibility="Hidden"
                                  local:FZScrollViewer.IsAtTop="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:FZScrollViewer.IsAtTop), Mode=OneWayToSource}"
                                  local:FZScrollViewer.IsAtBottom="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:FZScrollViewer.IsAtBottom), Mode=OneWayToSource}"
                                  Focusable="False"
                                  KeepSelectionOnScreen="True"
                                  Height="775">
                <WrapPanel Orientation="Vertical" IsItemsHost="True" local:ZPanel.DisableClipping="True"/>
            </local:FZScrollViewer>
        </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>
		
        <Style x:Key="A_Style_FZTextBlock_YourPasses"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="Text" Value="{Binding Tickets}" />
            <Setter Property="Color" Value="#FFFFFF" />            
            <Setter Property="TextAlignment" Value="Center" />
            <Setter Property="CapHeight" Value="30" />
        <Style.Triggers>
				        
        <DataTrigger Binding="{Binding Tickets, Converter={StaticResource A_CompareConverter}, ConverterParameter=99}"
         Value="{x:Static local:CompareResult.GreaterThan}">        
            <Setter Property="Text" Value="99+" />        
        </DataTrigger>
			</Style.Triggers>
        </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>

        <Style x:Key="A_Style_ContentControl_ScreenTitleBlock_ForzaEventsShop" TargetType="ContentControl" BasedOn="{StaticResource A_Style_ContentControl_ScreenTitleBlock}">
            <Style.Resources>
                <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_OuterRightOnly_TitleBlockIcon"
                                                    BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterLeftOnly}"
                                                    GradientColorA="{StaticResource A_Color_RareCarDealership_GradientA}"
                                                    GradientColorB="{StaticResource A_Color_RareCarDealership_GradientB}"
                                                    GradientAngle="90"/>
                <Color x:Key="A_Color_ScreenTitle_IconBackground">#FFFFFF</Color>
            </Style.Resources>
            <Setter Property="local:BindingProxy.B"
                    Value="{local:Loc Lobby.IDS_RareCarDealershipShop_Title }" />
            <Setter Property="Content"
                    Value="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource Self}, Converter={StaticResource A_StringToUpper}}" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding CustomTitle, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_StringVisConverter}}"
                             Value="{x:Static Visibility.Visible}">
                    <Setter Property="Content"
                            Value="{Binding CustomTitle, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_StringToUpper}}" />
                </DataTrigger>
            </Style.Triggers>
        </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}" />

        <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="Stretch"
                        Margin="0,0,0,49">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                    <ContentControl Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock_ForzaEventsShop}" 
                                    local:BindingProxy.A="/ForzaUI;component/Textures/Data_Bound/Rare_Car_Dealership/Title_Icon.png"
                                    HorizontalAlignment="Left"/>
                    <local:FZMaterial HorizontalAlignment="Right"
                                      Style="{StaticResource A_Style_FZMaterial_RareCarShopGradientBackground}"
                                      MinWidth="400"
                                      Margin="0,0,5,12"
                                      Height="68">
                        <DockPanel>

                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Rare_Car_Dealership/Ticket_Container.png" 
                                 Margin="0,-25,50,35" HorizontalAlignment="Right" DockPanel.Dock="Right">
                                <local:FZTextBlock x:Name= "NumOfPasses" Style="{StaticResource A_Style_FZTextBlock_YourPasses}"
                                                   HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   FontSize="45"/>
                            </local:FZMaterial>
                            <local:FZTextBlock Text="{Binding Source={local:Loc Lobby.IDS_RareCarDealershipShop_Passes}, Converter={StaticResource A_StringToUpper}}"
                                               Style="{StaticResource A_Style_FZTextBlock_HorizonA}"
                                               Margin="20,20,0,0"
                                               DockPanel.Dock="Left"
                                               Color="#ffffff"
                                               CapHeight="30"
                                               TextAlignment="Right"/>
                            <Decorator Width="20" DockPanel.Dock="Left" />
                        </DockPanel>
                    </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>
