<CarSelect DataContext="{Binding RelativeSource={RelativeSource Self}}"
           mc:Ignorable="d"
           x:Class="ForzaUI.A_CarSelect"
           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:ed="http://schemas.microsoft.com/expression/2010/drawing"
           xmlns:local="clr-namespace:ForzaUI;assembly="
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           Tag="{Binding DetailsToggle, Converter={LinearTransformConverter}}">
    <Page.Resources>
        <ResourceDictionary>
            <Style TargetType="ForzaScene"
                   x:Key="H_Style_ThisPage"
                   BasedOn="{StaticResource A_Style_Page_Generic}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding AnimateDetailsToggle}"
                                 Value="True">
                        <DataTrigger.EnterActions>
                            <BeginStoryboard>
                                <Storyboard FillBehavior="Stop">
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Tag"
                                                                   FillBehavior="Stop">
                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2"
                                                              Value="1"
                                                              EasingFunction="{CircleEasing EasingMode=EaseOut}" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </BeginStoryboard>
                        </DataTrigger.EnterActions>
                        <DataTrigger.ExitActions>
                            <BeginStoryboard>
                                <Storyboard FillBehavior="Stop">
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Tag"
                                                                   FillBehavior="Stop">
                                        <EasingDoubleKeyFrame KeyTime="0:0:0.2"
                                                              Value="0"
                                                              EasingFunction="{QuadraticEasing EasingMode=EaseOut}" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </BeginStoryboard>
                        </DataTrigger.ExitActions>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <local:NumUnitConverter FractionDigits="0"
                                    ShowUnit="False"
                                    x:Key="A_Converter_NumUnit" />

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

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

            <Style x:Key="A_Style_FZMaterial_RarityAndHorizonEditionBonusContainer"
                   TargetType="local:FZMaterial">
                <Setter Property="MinHeight"
                        Value="32" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding HorizonEditionBonus, Converter={StaticResource A_StringVisConverter}, FallbackValue=Collapsed}"
                                 Value="{x:Static Visibility.Visible}">
                        <Setter Property="MinHeight"
                                Value="47" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_NetworkCountdownControl_CarSelectCustom"
                   TargetType="{x:Type local:NetworkCountdownControl}"
                   BasedOn="{StaticResource A_Style_NetworkCountdownControl_Base}">
                <Setter Property="TimerDisplayName"
                        Value="{local:Loc Lobby.IDS_SelectYourCar_Countdown}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowEventSetupCountdown, RelativeSource={RelativeSource AncestorType=Page}}"
                                 Value="True">
                        <Setter Property="TimerDisplayName"
                                Value="{local:Loc Lobby.IDS_Event_Options_Countdown}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>


            <Style x:Key="A_Style_FZMaterial_CarSelect_CostBlock"
                   TargetType="{x:Type local:FZMaterial}"
                   BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_FooterPanel}">
                <Setter Property="Color"
                        Value="{StaticResource H_Color_Primary_Yellow}" />
                <Setter Property="Preset"
                        Value="{Roundtangle CornerRadius=2}" />
                <Setter Property="Margin"
                        Value="0,8,0,0" />
                <Setter Property="Height"
                        Value="64" />
                <Setter Property="GreedyMeasure"
                        Value="True" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding BlammoType}"
                                 Value="{x:Static local:MarketplaceBlammoType.OnSale}">
                        <Setter Property="Color"
                                Value="{StaticResource A_Color_ItemStatusBackground_Sale}" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsPhotoCaptured}"
                                       Value="0" />
                            <Condition Binding="{Binding Visibility, ElementName=PhotoCapturedFooterInfo}"
                                       Value="{x:Static Visibility.Visible}" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Color"
                                Value="{StaticResource A_Color_CarCollectionDetailPanelFooterLocked}" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_CarSelect_CurrentLargeIcon"
                   TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Stretch"
                        Value="Uniform" />
                <Setter Property="StretchDirection"
                        Value="DownOnly" />
                <Setter Property="HorizontalAlignment"
                        Value="Center" />
                <Setter Property="VerticalAlignment"
                        Value="Center" />
                <Setter Property="GreedyMeasure"
                        Value="True" />
            </Style>

            <local:MappingConverter x:Key="A_Converter_LocalPlayerIsHider_To_HideSeekRoleIcon">
                <local:MappingConverterEntry Key="False" Value="/ForzaUI;component/Textures/Data_Bound/Hide_Seek/Car_Selection/seeker_car_icon.png"/>
                <local:MappingConverterEntry Key="True" Value="/ForzaUI;component/Textures/Data_Bound/Hide_Seek/Car_Selection/hider_car_icon.png"/>
            </local:MappingConverter>

            <Style x:Key="A_Style_FZMaterial_CarSelect_CurrentLargeIcon_SecondItem"
                   BasedOn="{StaticResource A_Style_FZMaterial_CarSelect_CurrentLargeIcon}"
                   TargetType="{x:Type local:FZMaterial}">
                <Setter Property="ImageSource" Value="{Binding CarBucketIcon}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SceneEnum, RelativeSource={RelativeSource AncestorType=Page}}"
                                 Value="{x:Static local:SceneEntryEnum.CarSelectOnlineHideSeekGarage}">
                        <Setter Property="ImageSource" Value="{Binding LocalPlayerIsHider, Converter={StaticResource A_Converter_LocalPlayerIsHider_To_HideSeekRoleIcon}, RelativeSource={RelativeSource AncestorType=Page}}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_CarSelect_CurrentLargeIconContainer"
                   TargetType="{x:Type FrameworkElement}">
                <Setter Property="Height"
                        Value="166" />
                <Setter Property="Width"
                        Value="256" />
                <Setter Property="Visibility"
                        Value="Collapsed" />
                <Setter Property="Focusable"
                        Value="False" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                                 Value="True">
                        <Setter Property="Visibility"
                                Value="Visible" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ListBoxItem_CurrentLargeIcon"
                   TargetType="{x:Type ListBoxItem}">
                <Setter Property="Focusable"
                        Value="False" />
            </Style>

            <CornerRadius x:Key="A_CornerRadius_Selection">5</CornerRadius>
            <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_Selection"
                                               BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
                                               CornerRadius="{StaticResource A_CornerRadius_Selection}" />

            <!-- A_Style_Control_CarSelect_CurrentLargeIconSelection is the same visual style (and re-uses inner styles from) A_Style_ItemsSelector_SelectionDots in Shared_LiveTile.xaml 
             However, as that one is a template for ItemSelectors so it can have a data-driven number of dots, this one is designed for CarSelect where there are fixed dots declared in xaml with no data source
             and refactoring the LiveTile version so that they could share more is unnecessary overkill -->
            <Style x:Key="A_Style_Control_CarSelect_CurrentLargeIconSelection"
                   TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <FZMaterial x:Name="InnerFilling"
                                        Style="{StaticResource A_Style_Tile_SelectionDots_Base}">
                                <FZMaterial x:Name="OutlineStroke" 
                                            Style="{StaticResource A_Style_Tile_SelectionDots_Base_Outline}"/>
                            </FZMaterial>
                            <ControlTemplate.Triggers>
                                <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                                        Value="True">
                                    <Setter Property="Style" TargetName="OutlineStroke" Value="{StaticResource A_Style_Tile_SelectionDots_Selected_Base_Outline}"/>
                                    <Setter Property="Style" TargetName="InnerFilling" Value="{StaticResource A_Style_Tile_SelectionDots_Selected_Base}"/>
                                </DataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Width"
                        Value="20" />
                <Setter Property="Height"
                        Value="20" />
                <Setter Property="Margin"
                        Value="4,0" />
                <Setter Property="Focusable"
                        Value="False" />
            </Style>

          <Style x:Key="A_Style_FZMaterial_CarSelect_BackstagePassCostBlock"
                   TargetType="{x:Type local:FZMaterial}"
                   BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_FooterPanel}">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
            <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Data_Bound/Rare_Car_Dealership/Backstage_Pattern.png"/>
            <Setter Property="Preset" Value="{StaticResource H_Roundtangle_BottomOnly_3px}"/>
            <Setter Property="Height" Value="72" />
            <Setter Property="GreedyMeasure" Value="True" />
          </Style>


            <Style x:Key="A_Style_FrameworkElement_NoDataContextIfBarnFindUnrestored"
                   TargetType="FrameworkElement">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SelectedItem.BarnFindState, ElementName=PART_List, Converter={StaticResource A_Converter_BarnFindStateIsRestoredOrLater}}"
                                 Value="{StaticResource A_Boolean_False}">
                        <Setter Property="DataContext"
                                Value="{x:Null}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FrameworkElement_NoDataContextIfBarnFindUndiscovered"
                   TargetType="FrameworkElement">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SelectedItem.BarnFindState, ElementName=PART_List, Converter={StaticResource A_Converter_BarnFindStateIsDiscoveredOrLater}}"
                                 Value="{StaticResource A_Boolean_False}">
                        <Setter Property="DataContext"
                                Value="{x:Null}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FrameworkElement_HiddenIfBarnFindUndiscovered"
                   TargetType="FrameworkElement">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding BarnFindState, Converter={StaticResource A_Converter_BarnFindStateIsDiscoveredOrLater}}"
                                 Value="{StaticResource A_Boolean_False}">
                        <Setter Property="Visibility"
                                Value="Hidden" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_UnknownManufacturerIcon"
                   BasedOn="{StaticResource A_Style_FZMaterial_CarSelect_CurrentLargeIcon}"
                   TargetType="local:FZMaterial">
                <Setter Property="Visibility"
                        Value="Collapsed" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding BarnFindState, Converter={StaticResource A_Converter_BarnFindStateIsDiscoveredOrLater}}"
                                 Value="{StaticResource A_Boolean_False}">
                        <Setter Property="Visibility"
                                Value="Visible" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <local:MappingConverter x:Key="A_Converter_BarnFindStateToMessage"
                                    Default="{local:Loc BarnFind.IDS_CarState_Locked}">
                <local:MappingConverterEntry Key="{x:Static local:BarnFindStateEnum.Restored}"
                                             Value="{local:Loc BarnFind.IDS_CarState_Ready}" />
                <local:MappingConverterEntry Key="{x:Static local:BarnFindStateEnum.Collected}"
                                             Value="{local:Loc BarnFind.IDS_CarState_Restored}" />
                <local:MappingConverterEntry Key="{x:Static local:BarnFindStateEnum.DiscoveredNotAvailable}"
                                             Value="{local:Loc BarnFind.IDS_CarState_DiscoveredNotAvailable}" />
            </local:MappingConverter>

            <local:LinearTransformConverter x:Key="A_Int64ToInt32Converter" />

            <local:MultiConverter x:Key="A_Converter_BarnFindStateInt64ToInt32">
                <local:MultiConverterEntry Converter="{StaticResource A_Int64ToInt32Converter}"
                                           TargetType="{x:Type System:Int32}" />
            </local:MultiConverter>

            <local:MultiConverter x:Key="A_Converter_BarnFindStateInt64ToStatusMessage">
                <local:MultiConverterEntry Converter="{StaticResource A_Int64ToInt32Converter}"
                                           TargetType="{x:Type System:Int32}" />
                <local:MultiConverterEntry Converter="{StaticResource A_Converter_BarnFindStateToMessage}" />
            </local:MultiConverter>

            <Style x:Key="A_Style_TextBlock_CarSelect_BarnFindStatus"
                   BasedOn="{StaticResource A_Style_TextBlock_CarSelect_Cost}"
                   TargetType="local:FZTextBlock">
                <Setter Property="Text"
                        Value="{Binding BarnFindState, Converter={StaticResource A_Converter_BarnFindStateInt64ToStatusMessage}}" />
                <Setter Property="Stretch" Value="None"/>
                <Setter Property="AutoScroll.AllowScrolling" Value="True"/>
                <Setter Property="AutoScroll" Value="{StaticResource A_AutoScrollSettings_CarName}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding BarnFindState, Converter={StaticResource A_Converter_BarnFindStateInt64ToInt32}}"
                                 Value="{x:Static local:BarnFindStateEnum.Discovered}">
                        <Setter Property="Text"
                                Value="{Binding CurrentTask, RelativeSource={RelativeSource AncestorType={x:Type Page}}}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ContentControl_ScreenTitleBlock_CarSelect"
                   BasedOn="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                   TargetType="ContentControl">
                <Setter Property="local:BindingProxy.A"
                        Value="/ForzaUI;component/Textures/Anthem/Icons/Titles/SteeringWheel.png" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsBarnFindsScene}"
                                 Value="True">
                        <Setter Property="local:BindingProxy.A"
                                Value="/ForzaUI;component/Textures/Anthem/Icons/Titles/BarnFinds.png" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <local:MappingConverter x:Key="A_Converter_CarSelect_RarityToPreset_SelectedItem"
                                    Default="{StaticResource A_FZMaterialPreset_FlatPanel_Base}">
                <local:MappingConverterEntry Key="{x:Static local:XAMLRarity.HorizonEdition}"
                                             Value="{StaticResource A_FZMaterialPresetRoundtangle_GradientHorizonEdition}" />
            </local:MappingConverter>

          <local:MappingConverter x:Key="A_Converter_BackstagePassCountToString" Default="{local:Loc Lobby.IDS_BackstagePasses}">
            <local:MappingConverterEntry Key="1" Value="{local:Loc Lobby.IDS_BackstagePass}" />
          </local:MappingConverter>

            <Style x:Key="A_Style_ControllerButtonControl_CycleBadge"
                   TargetType="{x:Type local:ControllerButtonControl}"
                   BasedOn="{StaticResource A_Style_ControllerButtonControl_Default}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SelectedItem.IsFakeCarRecord}"
                                 Value="True">
                        <Setter Property="Visibility"
                                Value="{x:Static Visibility.Collapsed}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding SelectedItem.BarnFindState, Converter={StaticResource A_Converter_BarnFindStateIsDiscoveredOrLater}}"
                                 Value="{StaticResource A_Boolean_False}">
                        <Setter Property="Visibility"
                                Value="{x:Static Visibility.Collapsed}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>


            <Style x:Key="A_Style_FrameworkElement_CarSelectSidePanelContainer"
                   TargetType="{x:Type FrameworkElement}">
                <Setter Property="local:ManualPassthroughProperty.Allowed"
                        Value="{Binding SelectedItem, ElementName=PART_List, Converter={StaticResource A_Converter_TrueIfNotNull}}" />
                <Setter Property="local:ScreenReader.Line"
                        Value="{Binding (local:ManualPassthroughProperty.Output), RelativeSource={RelativeSource Self}}" />
                <Setter Property="local:ScreenReader.LineType"
                        Value="ItemDescription" />
                <Setter Property="local:ScreenReader.Event"
                        Value="OnChange" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsFakeCarRecord}"
                                 Value="{StaticResource A_Boolean_False}">
                        <Setter Property="local:MultiStringFormatter.Format"
                                Value="{local:Loc Main.IDS_ScreenReader_Format_CarSelect_PerformanceInfo}" />
                        <Setter Property="local:MultiStringFormatter.Param0"
                                Value="{Binding ClassID, Converter={StaticResource A_CarClassToStringConverter}, FallbackValue=?}" />
                        <Setter Property="local:MultiStringFormatter.Param1"
                                Value="{Binding PerformanceIndex, Converter={StaticResource A_PIConverter}, FallbackValue=?}" />
                        <Setter Property="local:MultiStringFormatter.Param2"
                                Value="{Binding PowertrainID, Converter={StaticResource A_PowertrainToStringConverter}, FallbackValue=?}" />
                        <Setter Property="local:MultiStringFormatter.Param3"
                                Value="{Binding Rarity, Converter={StaticResource A_Converter_RarityToNameString}, FallbackValue=?}" />
                        <Setter Property="local:ManualPassthroughProperty.Input"
                                Value="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsFakeCarRecord}"
                                       Value="{StaticResource A_Boolean_False}" />
                            <Condition Binding="{Binding HorizonEditionBonus, Converter={StaticResource A_StringVisConverter}}"
                                       Value="{x:Static Visibility.Visible}" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="local:MultiStringFormatter.Format"
                                Value="{local:Loc Main.IDS_ScreenReader_Format_CarSelect_PerformanceInfoWithBonus}" />
                        <Setter Property="local:MultiStringFormatter.Param4"
                                Value="{Binding HorizonEditionBonus, Converter={StaticResource A_Converter_TrimInlineMarkup}, FallbackValue=?}" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsFakeCarRecord}"
                                 Value="{StaticResource A_Boolean_True}">
                        <Setter Property="local:ManualPassthroughProperty.Input"
                                Value="{Binding Text, ElementName=SpecialItemInfoDesc}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding BarnFindState, Converter={StaticResource A_Converter_BarnFindStateIsDiscoveredOrLater}}"
                                 Value="{StaticResource A_Boolean_False}">
                        <Setter Property="local:ManualPassthroughProperty.Allowed"
                                Value="{StaticResource A_Boolean_False}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding BarnFindState, Converter={StaticResource A_Converter_BarnFindStateIsDiscoveredNotAvailable}}"
                                 Value="{StaticResource A_Boolean_True}">
                        <Setter Property="local:ManualPassthroughProperty.Allowed"
                                Value="{StaticResource A_Boolean_False}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <MappingConverter x:Key="H_Map_DetailedViewToString"
                              Default="{Loc CarFlow.IDS_SimpleView}">
                <MappingConverterEntry Key="{StaticResource A_Boolean_False}"
                                       Value="{Loc CarFlow.IDS_DetailedView}" />
            </MappingConverter>
            <MappingConverter x:Key="H_Map_DetailedViewToVisibility"
                              Default="Visible">
                <MappingConverterEntry Key="{StaticResource A_Boolean_False}"
                                       Value="Hidden" />
            </MappingConverter>
            <MappingConverter x:Key="H_Map_DetailedViewToAlignment"
                              Default="Right">
                <MappingConverterEntry Key="{StaticResource A_Boolean_False}"
                                       Value="Left" />
            </MappingConverter>
            <Color x:Key="A_Color_TransparentWhite">#64FFFFFF</Color>

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

            <Style x:Key="A_Style_FrameworkElement_PhotoCaptureFooterInfo"
                   TargetType="{x:Type FrameworkElement}">
                <Setter Property="Tag"
                        Value="{StaticResource A_Boolean_False}" />
                <Setter Property="Visibility"
                        Value="Collapsed" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShowPhotoInfo, RelativeSource={RelativeSource AncestorType=Page}, FallbackValue=False}"
                                       Value="{StaticResource A_Boolean_True}" />
                            <Condition Binding="{Binding Tag, RelativeSource={RelativeSource Self}, FallbackValue=False}"
                                       Value="{StaticResource A_Boolean_True}" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility"
                                Value="Visible" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_TextBlock_CarSelect_CostBackstagePass" TargetType="{x:Type FZTextBlock}" BasedOn="{StaticResource A_Style_TextBlock_CarSelect_CostOrFree}">
              <Style.Triggers>
                <DataTrigger Binding="{Binding BackstagePurchaseLimitReached}" Value="True">
                  <Setter Property="Text" Value="{local:Loc Lobby.IDS_Redeemed}"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding BackstagePurchaseLimitReached}" Value="False">
                  <Setter Property="Text" Value="{Binding BackstagePassCost, Converter={StaticResource A_Converter_BackstagePassCountToString}}"/>
                </DataTrigger>
              </Style.Triggers>
            </Style>
        </ResourceDictionary>
    </Page.Resources>
    <Page.Style>
        <StaticResourceExtension ResourceKey="H_Style_ThisPage" />
    </Page.Style>
    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Menu}" />
    </local:UIPageTransitionManager.TransitionManager>
    <Grid x:Name="PART_LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="RightPanelContentStateGroup">
                <VisualState x:Name="PART_CarStatsPerfBars">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PerformanceStats"
                                                       Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="{x:Static Visibility.Hidden}" />
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PerformanceBars"
                                                       Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="{x:Static Visibility.Visible}" />
                        </ObjectAnimationUsingKeyFrames>
                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PhotoCapturedFooterInfo"
                                                        Storyboard.TargetProperty="Tag">
                            <DiscreteBooleanKeyFrame KeyTime="0"
                                                     Value="{StaticResource A_Boolean_True}" />
                        </BooleanAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="PART_CarStatsPerfStats">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PerformanceBars"
                                                       Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="{x:Static Visibility.Hidden}" />
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PerformanceStats"
                                                       Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="{x:Static Visibility.Visible}" />
                        </ObjectAnimationUsingKeyFrames>
                        <BooleanAnimationUsingKeyFrames Storyboard.TargetName="PhotoCapturedFooterInfo"
                                                        Storyboard.TargetProperty="Tag">
                            <DiscreteBooleanKeyFrame KeyTime="0"
                                                     Value="{StaticResource A_Boolean_False}" />
                        </BooleanAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
            <VisualStateGroup x:Name="SpecialSelectionVisualStateGroup">
                <VisualState x:Name="PART_ViewCarVisualState" />
                <VisualState x:Name="PART_ViewCarSaleVisualState">
                    <Storyboard>
                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(local:FZMaterial.Color)"
                                                      Storyboard.TargetName="FooterBox">
                            <EasingColorKeyFrame KeyTime="0"
                                                 Value="{StaticResource A_Color_TileSelected_Background}" />
                        </ColorAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="PART_BuyCarButtonVisualState">
                    <Storyboard>
                        <StringAnimationUsingKeyFrames Storyboard.TargetName="SpecialItemInfoDesc"
                                                       Storyboard.TargetProperty="(local:FZTextBlock.Text)">
                            <DiscreteStringKeyFrame KeyTime="0"
                                                    Value="{local:Loc CarFlow.IDS_PurchaseCarDesc}" />
                        </StringAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="PART_AllCarsButtonVisualState">
                    <Storyboard>
                        <StringAnimationUsingKeyFrames Storyboard.TargetName="SpecialItemInfoDesc"
                                                       Storyboard.TargetProperty="(local:FZTextBlock.Text)">
                            <DiscreteStringKeyFrame KeyTime="0"
                                                    Value="{local:Loc CarFlow.IDS_AllCars_Desc}" />
                        </StringAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="PART_RentalCarsButtonVisualState">
                    <Storyboard>
                        <StringAnimationUsingKeyFrames Storyboard.TargetName="SpecialItemInfoDesc"
                                                       Storyboard.TargetProperty="(local:FZTextBlock.Text)">
                            <DiscreteStringKeyFrame KeyTime="0"
                                                    Value="{local:Loc CarFlow.IDS_RentalCar_Desc}" />
                        </StringAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="PART_BorrowLeadersCarButtonVisualState">
                    <Storyboard>
                        <StringAnimationUsingKeyFrames Storyboard.TargetName="SpecialItemInfoDesc"
                                                       Storyboard.TargetProperty="(local:FZTextBlock.Text)">
                            <DiscreteStringKeyFrame KeyTime="0"
                                                    Value="{local:Loc CarFlow.IDS_BorrowLeaderCar_Desc}" />
                        </StringAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="PART_LoyaltyRewardVisualState">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                       Storyboard.TargetName="LoyaltyRewardInfo">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="{x:Static Visibility.Visible}" />
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
            <VisualStateGroup x:Name="BackgroundVisualStateGroup">
                <VisualState x:Name="PART_DefaultBackgroundVisualState" />
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <PageInputHandler Command="{Binding ToggleDetailsCommand}"
                          Button="R3"
                          x:Name="details_toggle_input" />
        <Control x:Name="DefaultBackground"
                 Style="{StaticResource A_Style_Control_ScreenBackground}" />

        <local:RoutedEventCommand x:Name="ToggleDetailsRoutedEventCommand"
                                  RoutedEvent="UIElement.MouseLeftButtonDown"
                                  Command="{Binding ToggleDetailsCommand}" />

        <local:RoutedEventCommand x:Name="ToggleStatsRoutedEventCommand"
                                  RoutedEvent="UIElement.MouseLeftButtonDown"
                                  Command="{Binding ToggleStatsCommand}" />

        <local:RoutedEventCommand x:Name="CycleBadgeRoutedEventCommand"
                                  RoutedEvent="UIElement.MouseLeftButtonDown"
                                  Command="{Binding CycleBadgeCommand}" />

        <!-- Bars -->
        <local:PlayerBarControl Style="{StaticResource A_Style_PlayerBarControl_WithTokens}"
                                x:Name="TopBar" />
        <ContentControl Style="{StaticResource A_Style_ButtonBar}"
                        x:Name="BottomBar">
            <local:ControllerButtonPanel x:Name="PART_HelpPanel"
                                         Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <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="{local:Loc HelpButtons.IDS_Sort}"
                                               Visibility="{Binding IsBarnFindsScene, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}" />
                <local:ControllerButtonControl Button="Y"
                                               Description="{local:Loc HelpButtons.IDS_CarFilter}"
                                               Visibility="{Binding IsBarnFindsScene, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}" />
                <local:ControllerButtonControl Button="R3"
                                               Description="{local:Loc CarFlow.IDS_ToggleDetail}"
                                               InputOverride="{local:Input Command=INPUTCMD_UI_RIGHT_STICK_CLICK, Context=INPUTCONTEXT_UI}"
                                               Visibility="{Binding IsBarnFindsScene, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"
                                               local:RoutedEventCommand.Action="{Binding ElementName=ToggleDetailsRoutedEventCommand}" />
                <local:ControllerButtonControl Style="{StaticResource A_Style_ControllerButtonControl_CycleBadge}"
                                               Button="RThumb_Right"
                                               InputOverride="{local:Input Command=INPUTCMD_UI_RIGHT_STICK_RIGHT, Context=INPUTCONTEXT_UI}"
                                               Description="{local:Loc HelpButtons.IDS_ToggleStats}"
                                               local:RoutedEventCommand.Action="{Binding ElementName=CycleBadgeRoutedEventCommand}" />
            </local:ControllerButtonPanel>
        </ContentControl>

        <local:NetworkCountdownControl Style="{StaticResource A_Style_NetworkCountdownControl_CarSelectCustom}"
                                       AudioEnabled="True"
                                       WarningSeconds="0" />

        <Border Style="{StaticResource A_Style_Border_ScenePadding_Opus}"
                Padding="0">
            <Decorator x:Name="Frame"
                       Width="1688"
                       Margin="0,96,0,0">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                    <StackPanel>
                        <Decorator HorizontalAlignment="Left"
                                   VerticalAlignment="Top">
                            <ContentControl Content="{Binding Title}"
                                            Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock_CarSelect}"
                                            x:Name="TitleBlock" />
                        </Decorator>

                        <FZButtonsSelector x:Name="PART_ManufacturerItemsSelector"
                                           HorizontalAlignment="Center"
                                           WrapSelection="True"
                                           ItemsSource="{Binding Groups}"
                                           SelectedIndex="{Binding CurrentGroupIndex}"
                                           Style="{StaticResource H_Style_TabBar_Scrolling}"
                                           Width="1688"
                                           Visibility="{Binding IsBarnFindsScene, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                            <FZButtonsSelector.ItemContainerStyle>
                                <Style TargetType="FZButton"
                                       BasedOn="{StaticResource H_Style_TabButton_Scrolling}">
                                    <Setter Property="Content"
                                            Value="{Binding Text, Converter={StringToUpper}}" />
                                </Style>
                            </FZButtonsSelector.ItemContainerStyle>
                        </FZButtonsSelector>

                        <Grid Margin="0,8,0,0"
                              HorizontalAlignment="Stretch">
                            <local:WrapListBox Style="{StaticResource H_Style_FullScreenCarousel}"
                                               ItemTemplate="{StaticResource A_DataTemplate_CarSelectCarouselItem}"
                                               SelectedItem="{Binding SelectedItem}"
                                               ItemsSource="{Binding Collection}"
                                               SelectionLimitTop="292"
                                               VerticalAlignment="Top"
                                               Margin="0,0,0,0"
                                               local:CollectionIndexer.Collection="{Binding Collection}"
                                               x:Name="PART_List"
                                               DeferFailedFocusAttempts="False"
                                               local:FocusOnPageFocusGained.SelectorSelectedItem="True" />
                            <Grid DataContext="{Binding SelectedItem, ElementName=PART_List}"
                                  HorizontalAlignment="Left"
                                  VerticalAlignment="Top"
                                  Style="{StaticResource A_Style_FrameworkElement_CarSelectSidePanelContainer}">
                                <DockPanel LastChildFill="True"
                                           Width="284"
                                           Height="748">
                                    <Grid DockPanel.Dock="Left"
                                          Tag="{x:Null}"
                                          x:Name="PerformancePanel"
                                          local:RoutedEventCommand.Action="{Binding ElementName=ToggleStatsRoutedEventCommand}">
                                        <Grid>

                                            <Grid>
                                                <DockPanel x:Name="PerformanceInfo"
                                                           Visibility="{Binding IsFakeCarRecord, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                                                    <ContentControl Template="{StaticResource A_ControlTemplate_SidePanelContent}"
                                                                    DockPanel.Dock="Top">
                                                        <Grid>
                                                            <local:FZMaterialGlassCapture />
                                                            <DockPanel LastChildFill="False">
                                                                <Grid HorizontalAlignment="Center"
                                                                      DockPanel.Dock="Top"
                                                                      Margin="12">
                                                                    <local:CommonListBox x:Name="PART_CurrentCarLargeIconBox"
                                                                                         PageSize="1"
                                                                                         Focusable="False"
                                                                                         SelectedIndex="0"
                                                                                         ItemContainerStyle="{StaticResource A_Style_ListBoxItem_CurrentLargeIcon}"
                                                                                         Style="{StaticResource A_Style_FrameworkElement_HiddenIfBarnFindUndiscovered}">
                                                                        <Decorator Style="{StaticResource A_Style_FZMaterial_CarSelect_CurrentLargeIconContainer}">
                                                                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_CarSelect_CurrentLargeIcon_SecondItem}" />
                                                                        </Decorator>
                                                                        <Decorator Style="{StaticResource A_Style_FZMaterial_CarSelect_CurrentLargeIconContainer}">
                                                                            <local:FZMaterial ImageSource="{Binding ManufacturerIcon}"
                                                                                              Style="{StaticResource A_Style_FZMaterial_CarSelect_CurrentLargeIcon}" />
                                                                        </Decorator>
                                                                    </local:CommonListBox>
                                                                    <Decorator Style="{StaticResource A_Style_FZMaterial_CarSelect_CurrentLargeIconContainer}"
                                                                               Visibility="Visible">
                                                                        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/UI_Symbols/BarnFind_UnknownManufacturer.png"
                                                                                          Style="{StaticResource A_Style_FZMaterial_UnknownManufacturerIcon}"
                                                                                          Color="{StaticResource A_Color_TransparentWhite}" />
                                                                    </Decorator>
                                                                </Grid>
                                                                <Decorator DockPanel.Dock="Top"
                                                                           Style="{StaticResource A_Style_FrameworkElement_HiddenIfBarnFindUndiscovered}">
                                                                    <local:CommonListBox x:Name="CurrentSelectionInCarLargeIconBox"
                                                                                         SelectedIndex="{Binding SelectedIndex, ElementName=PART_CurrentCarLargeIconBox}"
                                                                                         HorizontalAlignment="Center"
                                                                                         PageSize="1"
                                                                                         Focusable="False"
                                                                                         Margin="0,0,0,8">
                                                                        <Control Style="{StaticResource A_Style_Control_CarSelect_CurrentLargeIconSelection}" />
                                                                        <Control Style="{StaticResource A_Style_Control_CarSelect_CurrentLargeIconSelection}" />
                                                                    </local:CommonListBox>
                                                                </Decorator>
                                                            </DockPanel>
                                                        </Grid>
                                                    </ContentControl>
                                                    <Grid Height="60"
                                                          DockPanel.Dock="Top">
                                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_RarityAndHorizonEditionBonusContainer}"
                                                                          Preset="{Binding Rarity, Converter={StaticResource A_Converter_CarSelect_RarityToPreset_SelectedItem}}"
                                                                          Color="{Binding Rarity, Converter={StaticResource A_Converter_RarityToColor}}"
                                                                          Visibility="{Binding SceneEnum, FallbackValue=Visible, Converter={StaticResource A_Converter_VisibleWhenHideSeek_Inverse}, RelativeSource={RelativeSource AncestorType=Page}}">
                                                            <StackPanel Orientation="Vertical"
                                                                        VerticalAlignment="Center">
                                                                <local:FZTextBlock Text="{Binding Rarity, Converter={StaticResource A_Converter_RarityToNameString}}"
                                                                                   HorizontalAlignment="Center"
                                                                                   CapHeight="18"
                                                                                   FontFamily="Horizon_A"
                                                                                   Color="{Binding Rarity, Converter={StaticResource A_Converter_CarRarityToTextColor}}">
                                                                    <FZTextBlock.Style>
                                                                        <Style TargetType="FZTextBlock">
                                                                            <Style.Triggers>
                                                                                <DataTrigger Binding="{Binding Rarity, Converter={StaticResource A_Converter_ShouldRarityUseItalic}}"
                                                                                             Value="True">
                                                                                    <Setter Property="RenderTransform"
                                                                                            Value="{StaticResource A_Transform_Italic}" />
                                                                                </DataTrigger>
                                                                            </Style.Triggers>
                                                                        </Style>
                                                                    </FZTextBlock.Style>
                                                                </local:FZTextBlock>
                                                                <local:FZTextBlock Margin="0,6,0,0"
                                                                                   Text="{Binding HorizonEditionBonus, Converter={StaticResource A_StringToUpper}}"
                                                                                   MarkupConverter="{StaticResource A_MappingConverter_CarSelect_Bold}"
                                                                                   HorizontalAlignment="Center"
                                                                                   CapHeight="18"
                                                                                   Color="{StaticResource H_Color_Primary_White}"
                                                                                   Visibility="{Binding HorizonEditionBonus, Converter={StaticResource A_StringVisConverter}}"
                                                                                   FontFamily="Horizon_B" />
                                                            </StackPanel>
                                                        </local:FZMaterial>
                                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_RarityAndHorizonEditionBonusContainer}"
                                                                          Color="{Binding LocalPlayerIsHider, Converter={StaticResource A_Converter_HideSeekColor}, RelativeSource={RelativeSource AncestorType=Page}}"
                                                                          Visibility="{Binding SceneEnum, FallbackValue=Visible, Converter={StaticResource A_Converter_VisibleWhenHideSeek}, RelativeSource={RelativeSource AncestorType=Page}}">
                                                            <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                                                <local:FZTextBlock Text="{Binding LocalPlayerIsHider, Converter={StaticResource A_Converter_HideSeekCarInfoText}, RelativeSource={RelativeSource AncestorType=Page}}"
                                                                                   HorizontalAlignment="Center" 
                                                                                   CapHeight="18" 
                                                                                   FontFamily="Horizon_A"
                                                                                   Color="{StaticResource H_Color_Primary_White}">
                                                                </local:FZTextBlock>
                                                            </StackPanel>
                                                        </local:FZMaterial>
                                                    </Grid>
                                                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_CarSelect_CostBlock}"
                                                                      x:Name="FooterBox"
                                                                      DockPanel.Dock="Bottom"
                                                                      Visibility="{Binding ShowCost, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                                        <Grid>
                                                            <Grid Visibility="{Binding IsBarnFindsScene, FallbackValue=Visible, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"
                                                                  HorizontalAlignment="Center"
                                                                  VerticalAlignment="Center">
                                                                <Grid HorizontalAlignment="Center"
                                                                      VerticalAlignment="Center"
                                                                      Visibility="{Binding Visibility, ElementName=PhotoCapturedFooterInfo, Converter={StaticResource A_Converter_VisiblityInverse}}">
                                                                    <StackPanel Orientation="Horizontal"
                                                                                Visibility="{Binding CannotBeObtained, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}, FallbackValue=Visible}">
                                                                        <Control Style="{StaticResource H_Style_Control_CreditsIcon}" Margin="0,0,6,0"/>
                                                                        <local:FZTextBlock x:Name="CreditsCostBlock"
                                                                                           Style="{StaticResource A_Style_TextBlock_CarSelect_CostOrFree}"
                                                                                           Tag="{Binding CarCreditCost, FallbackValue=0}" />
                                                                        <DockPanel x:Name="TokensCostBlock"
                                                                                   Margin="25,0,0,0"
                                                                                   Visibility="{Binding AreTokensEnabled, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                                                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Anthem/CarSelect/Token_CarSelect.png"
                                                                                              Width="80"
                                                                                              Height="68"
                                                                                              Stretch="Uniform"
                                                                                              DockPanel.Dock="Left"
                                                                                              Margin="0,0,-32,0" />
                                                                            <Viewbox StretchDirection="DownOnly">
                                                                                <local:FZTextBlock Style="{StaticResource A_Style_TextBlock_CarSelect_CostOrFree}"
                                                                                                   Tag="{Binding CarTokenCost, ConverterParameter=tokenmoney, Converter={StaticResource A_Converter_NumUnit}, FallbackValue=0}"
                                                                                                   HorizontalAlignment="Left" />
                                                                            </Viewbox>
                                                                        </DockPanel>
                                                                    </StackPanel>
                                                                </Grid>
                                                                <StackPanel Style="{StaticResource A_Style_FrameworkElement_PhotoCaptureFooterInfo}"
                                                                            Orientation="Horizontal"
                                                                            HorizontalAlignment="Center"
                                                                            VerticalAlignment="Bottom"
                                                                            x:Name="PhotoCapturedFooterInfo">
                                                                    <DockPanel x:Name="PromoPhotoCapturedBlock">
                                                                        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Promo/Car_Collection/CarSelectDescription_CameraIcon.png"
                                                                                          Width="85"
                                                                                          Height="68"
                                                                                          Stretch="Uniform"
                                                                                          DockPanel.Dock="Left"
                                                                                          Margin="0,0,-32,0" />
                                                                        <Viewbox StretchDirection="DownOnly">
                                                                            <local:FZTextBlock Style="{StaticResource A_Style_TextBlock_CarSelect_CapturedNotCaptured}"
                                                                                               HorizontalAlignment="Left" />
                                                                        </Viewbox>
                                                                    </DockPanel>
                                                                </StackPanel>
                                                            </Grid>
                                                            <Decorator Visibility="{Binding IsBarnFindsScene, FallbackValue=Collapsed, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                                                       Margin="8">
                                                                <local:FZTextBlock Style="{StaticResource A_Style_TextBlock_CarSelect_BarnFindStatus}"
                                                                                   HorizontalAlignment="Center" />
                                                            </Decorator>
                                                        </Grid>
                                                    </local:FZMaterial>

                                                   <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_CarSelect_BackstagePassCostBlock}"
                                                                     x:Name="BackstagePassFooterBox"
                                                                     DockPanel.Dock="Bottom"
                                                                     Visibility="{Binding SceneEnum, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_SceneEnumToBackstagePassVisibility}}">
                                                       <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                                                           <local:FZMaterial DockPanel.Dock="Left" ImageSource="/ForzaUI;component/Textures/Data_Bound/Rare_Car_Dealership/Backstage_Currency_Box_Large.png" Height="50" Width="50" Margin="10,0,0,0">
                                                               <local:FZTextBlock Text="{Binding BackstagePassCost}"
                                                                                  Color="{StaticResource H_Color_Primary_White}"
                                                                                  Margin="15,17,15,15"
                                                                                  HorizontalAlignment="Center" VerticalAlignment="Center" CapHeight="18"/>
                                                           </local:FZMaterial>
                                                           <local:FZTextBlock Style="{StaticResource A_Style_TextBlock_CarSelect_CostBackstagePass}"
                                                                              Color="{StaticResource H_Color_Primary_White}"
                                                                              CapHeight="24"
                                                                              Margin="15"/>
                                                       </DockPanel>
                                                   </local:FZMaterial>

                                                    <local:FZMaterial x:Name="DriveTrainBackground"
                                                                      DockPanel.Dock="Bottom"
                                                                      Color="{StaticResource H_Color_Primary_Black}"
                                                                      Preset="{Roundtangle CornerRadius={CornerRadius BottomLeft=2, BottomRight=2}}">
                                                        <Grid Margin="12,12,12,12"
                                                              DockPanel.Dock="Bottom"
                                                              Height="40"
                                                              Style="{StaticResource A_Style_FrameworkElement_NoDataContextIfBarnFindUndiscovered}">
                                                            <Grid HorizontalAlignment="Left"
                                                                  Visibility="{Binding SceneEnum, FallbackValue=Visible, Converter={StaticResource A_Converter_VisibleWhenHideSeek_Inverse}, RelativeSource={RelativeSource AncestorType=Page}}"
                                                                  Style="{StaticResource A_Style_FrameworkElement_NoDataContextIfBarnFindUnrestored}">
                                                                <Control Style="{StaticResource A_Style_Control_CarClassBadge_Small}"
                                                                         Tag="White"
                                                                         local:BindingProxy.A="{Binding PerformanceIndex}"
                                                                         local:BindingProxy.B="{Binding ClassID}"
                                                                         Visibility="{Binding EliminatorLevel, Converter={StaticResource A_Converter_HiddenIfValid}, FallbackValue={x:Static Visibility.Visible}}" />
                                                                <Control Template="{StaticResource A_ControlTemplate_EliminatorCarLevel_Large}"
                                                                         Visibility="{Binding EliminatorLevel, Converter={StaticResource A_Converter_VisibleIfValid}, FallbackValue={x:Static Visibility.Collapsed}}" />
                                                            </Grid>
                                                            <Control Style="{StaticResource A_Style_Control_DriveTrainDisplay}"
                                                                     HorizontalAlignment="Right" 
                                                                     Visibility="{Binding SceneEnum, FallbackValue=Visible, Converter={StaticResource A_Converter_VisibleWhenHideSeek_Inverse}, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                                            <Control Style="{StaticResource A_Style_Control_DriveTrainDisplay}"
                                                                     HorizontalAlignment="Left" 
                                                                     Visibility="{Binding SceneEnum, FallbackValue=Visible, Converter={StaticResource A_Converter_VisibleWhenHideSeek}, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                                        </Grid>
                                                    </local:FZMaterial>
                                                    <local:FZMaterial x:Name="PerformanceStatsBackground"
                                                                      Color="{StaticResource H_Color_Primary_Black}">
                                                        <Grid Margin="12,0"
                                                              Style="{StaticResource A_Style_FrameworkElement_NoDataContextIfBarnFindUnrestored}">
                                                            <Grid.Resources>
                                                                <Style TargetType="FZTextBlock"
                                                                       x:Key="H_Style_StatName">
                                                                    <Setter Property="Color"
                                                                            Value="{StaticResource H_Color_Primary_White}" />
                                                                    <Setter Property="CapHeight"
                                                                            Value="19" />
                                                                    <Setter Property="FontFamily"
                                                                            Value="Horizon_A" />
                                                                    <Setter Property="VerticalAlignment"
                                                                            Value="Center" />
                                                                </Style>
                                                            </Grid.Resources>
                                                            <Grid x:Name="PerformanceBars">
                                                                <DockPanel>
                                                                    <StackPanel Orientation="Vertical"
                                                                                DockPanel.Dock="Top">
                                                                        <StackPanel.Resources>
                                                                            <Style TargetType="ContentPresenter"
                                                                                   x:Key="H_Style_StatValue">
                                                                                <Setter Property="VerticalAlignment"
                                                                                        Value="Center" />
                                                                                <Setter Property="DockPanel.Dock"
                                                                                        Value="Right" />
                                                                                <Setter Property="ContentTemplate">
                                                                                    <Setter.Value>
                                                                                        <DataTemplate>
                                                                                            <FZTextBlock x:Name="text"
                                                                                                         Color="{StaticResource H_Color_Primary_White}"
                                                                                                         CapHeight="19"
                                                                                                         FontFamily="Horizon_A_tf"
                                                                                                         VerticalAlignment="Center"
                                                                                                         Text="{Binding Converter={NumUnitConverter FractionDigits=1}, FallbackValue={local:Loc BarnFind.IDS_UnknownValue}}" />
                                                                                            <DataTemplate.Triggers>
                                                                                                <DataTrigger Binding="{Binding}">
                                                                                                    <DataTrigger.Value>
                                                                                                        <Double>10</Double>
                                                                                                    </DataTrigger.Value>
                                                                                                    <Setter TargetName="text"
                                                                                                            Property="Text"
                                                                                                            Value="{Binding Converter={NumUnitConverter FractionDigits=0}, FallbackValue={local:Loc BarnFind.IDS_UnknownValue}}" />
                                                                                                    <Setter TargetName="text"
                                                                                                            Property="Color"
                                                                                                            Value="{StaticResource H_Color_Primary_Green}" />
                                                                                                </DataTrigger>
                                                                                            </DataTemplate.Triggers>
                                                                                        </DataTemplate>
                                                                                    </Setter.Value>
                                                                                </Setter>
                                                                            </Style>
                                                                        </StackPanel.Resources>
                                                                        <DockPanel Height="43">
                                                                            <ContentPresenter Style="{StaticResource H_Style_StatValue}"
                                                                                              Content="{Binding SpeedRating}" />
                                                                            <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                         Text="{local:Loc CarFlow.IDS_Stat_Speed}" />
                                                                        </DockPanel>
                                                                        <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                        <DockPanel Height="43">
                                                                            <ContentPresenter Style="{StaticResource H_Style_StatValue}"
                                                                                              Content="{Binding HandlingRating}" />
                                                                            <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                         Text="{local:Loc CarFlow.IDS_Stat_Handling}" />
                                                                        </DockPanel>
                                                                        <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                        <DockPanel Height="43">
                                                                            <ContentPresenter Style="{StaticResource H_Style_StatValue}"
                                                                                              Content="{Binding AccelerationRating}" />
                                                                            <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                         Text="{local:Loc CarFlow.IDS_Stat_Accel}" />
                                                                        </DockPanel>
                                                                        <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                        <DockPanel Height="43">
                                                                            <ContentPresenter Style="{StaticResource H_Style_StatValue}"
                                                                                              Content="{Binding LaunchRating}" />
                                                                            <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                         Text="{local:Loc CarFlow.IDS_Stat_Launch}" />
                                                                        </DockPanel>
                                                                        <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                        <DockPanel Height="43">
                                                                            <ContentPresenter Style="{StaticResource H_Style_StatValue}"
                                                                                              Content="{Binding BrakingRating}" />
                                                                            <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                         Text="{local:Loc CarFlow.IDS_Stat_Braking}" />
                                                                        </DockPanel>
                                                                        <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                        <DockPanel Height="43">
                                                                            <ContentPresenter Style="{StaticResource H_Style_StatValue}"
                                                                                              Content="{Binding OffroadRating}" />
                                                                            <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                         Text="{local:Loc CarFlow.IDS_Stat_Offroad}" />
                                                                        </DockPanel>
                                                                        <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                    </StackPanel>
                                                                    <DockPanel Visibility="{Binding TireLevel, Converter={StaticResource H_Converter_TyreLevelToIconVisibility}}">
                                                                        <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}"
                                                                                    DockPanel.Dock="Bottom"
                                                                                    Margin="0,0,0,0" />
                                                                        <Grid DockPanel.Dock="Left"
                                                                              Width="40"
                                                                              Height="40"
                                                                              Margin="0,0,8,0">
                                                                            <local:FZMaterial Preset="{StaticResource H_Roundtangle_Outer_2px}"
                                                                                              Color="{StaticResource H_Color_Primary_White}" />
                                                                            <local:FZMaterial Preset="{StaticResource H_Roundtangle_Outer_2px}"
                                                                                              Color="{StaticResource H_Color_Primary_Black}"
                                                                                              ImageSource="{Binding TireLevel, Converter={StaticResource H_Converter_TyreLevelToIcon}}" />
                                                                        </Grid>
                                                                        <FZTextBlock CapHeight="19"
                                                                                     Color="{StaticResource H_Color_Primary_White}"
                                                                                     FontFamily="Horizon_A"
                                                                                     VerticalAlignment="Center"
                                                                                     HorizontalAlignment="Left"
                                                                                     Text="{Binding TireLevel, Converter={StaticResource H_Converter_TyreLevelToText}}" />
                                                                    </DockPanel>
                                                                </DockPanel>
                                                            </Grid>
                                                            <Grid Visibility="Hidden"
                                                                  x:Name="PerformanceStats">
                                                                <Grid.Resources>
                                                                    <Style TargetType="FZTextBlock"
                                                                           x:Key="H_Style_StatValue">
                                                                        <Setter Property="DockPanel.Dock"
                                                                                Value="Right" />
                                                                        <Setter Property="Color"
                                                                                Value="{StaticResource H_Color_Primary_White}" />
                                                                        <Setter Property="CapHeight"
                                                                                Value="19" />
                                                                        <Setter Property="FontFamily"
                                                                                Value="Horizon_A" />
                                                                        <Setter Property="VerticalAlignment"
                                                                                Value="Center" />
                                                                    </Style>
                                                                </Grid.Resources>
                                                                <StackPanel>
                                                                    <DockPanel Height="43">
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatValue}"
                                                                                     Text="{Binding SimPeakPower, ConverterParameter=power, Converter={NumUnitConverter FractionDigits=0}, FallbackValue={local:Loc BarnFind.IDS_UnknownValue}}" />
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                     Text="{local:Loc CarFlow.IDS_Stat_Power}" />
                                                                    </DockPanel>
                                                                    <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                    <DockPanel Height="43">
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatValue}"
                                                                                     Text="{Binding SimPeakTorque, ConverterParameter=torque, Converter={NumUnitConverter FractionDigits=0}, FallbackValue={local:Loc BarnFind.IDS_UnknownValue}}" />
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                     Text="{local:Loc CarFlow.IDS_Stat_Torque}" />
                                                                    </DockPanel>
                                                                    <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                    <DockPanel Height="43">
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatValue}"
                                                                                     Text="{Binding CurbWeight, ConverterParameter=mass, Converter={NumUnitConverter FractionDigits=0}, FallbackValue={local:Loc BarnFind.IDS_UnknownValue}}" />
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                     Text="{local:Loc CarFlow.IDS_Stat_Weight}" />
                                                                    </DockPanel>
                                                                    <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                    <DockPanel Height="43">
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatValue}"
                                                                                     Text="{Binding WeightDistribution, ConverterParameter=fracpercentage, Converter={NumUnitConverter FractionDigits=0}, FallbackValue={local:Loc BarnFind.IDS_UnknownValue}}" />
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                     Text="{local:Loc CarFlow.IDS_Stat_Front}" />
                                                                    </DockPanel>
                                                                    <FZMaterial Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                    <DockPanel Height="43" Visibility="{Binding EngineConfigID, Converter={StaticResource A_MappingConverter_HideWhenElectricEngine}}">
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatValue}"
                                                                                     Text="{Binding Displacement, ConverterParameter=displacement, Converter={NumUnitConverter FractionDigits=2}, FallbackValue={local:Loc BarnFind.IDS_UnknownValue}}" />
                                                                        <FZTextBlock Style="{StaticResource H_Style_StatName}"
                                                                                     Text="{local:Loc CarFlow.IDS_Stat_Displacement}" />
                                                                    </DockPanel>
                                                                    <FZMaterial Visibility="{Binding EngineConfigID, Converter={StaticResource A_MappingConverter_HideWhenElectricEngine}}"
                                                                                Style="{StaticResource H_Style_StatDivider_InfoPanel}" />
                                                                </StackPanel>
                                                            </Grid>
                                                        </Grid>
                                                    </local:FZMaterial>
                                                </DockPanel>
                                                <DockPanel Visibility="{Binding IsFakeCarRecord, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                                    <Grid DockPanel.Dock="Top" Height="208">
                                                        <FZMaterialGlassCapture/>
                                                        <FZMaterial Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"
                                                            Preset="{GlassRoundtangle BasedOn={StaticResource H_GlassRoundtangle_2px}, CornerRadius={CornerRadius TopLeft=2, TopRight=2}}"
                                                            Margin="0"
                                                            DockPanel.Dock="Bottom" />
                                                        <FZMaterial ImageSource="game:\Media\UI\Textures\Data_Bound\ui_symbols\Car_Fake.png" Stretch="Uniform" />
                                                    </Grid>
                                                    <Grid>
                                                        <FZMaterial Color="{StaticResource H_Color_Primary_Black}" Preset="{Roundtangle CornerRadius={CornerRadius BottomLeft=2, BottomRight=2}}"/>
                                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Body}"
                                                                           Color="{StaticResource A_Color_Body_Text}"
                                                                           Margin="24"
                                                                           TextWrapping="Wrap"
                                                                           x:Name="SpecialItemInfoDesc"
                                                                           FontSize="22" />
                                                    </Grid>
                                                </DockPanel>
                                            </Grid>
                                        </Grid>

                                        <FZMaterial Color="#0fff"
                                                    IsHitTestVisible="True" />

                                        <Control Style="{StaticResource A_Style_Control_MouseRollover_Outer_All}"
                                                    Visibility="{Binding IsMouseOver, ElementName=PerformancePanel, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />

                                    </Grid>
                                </DockPanel>
                            </Grid>
                        </Grid>
                    </StackPanel>
                </Grid>
            </Decorator>
        </Border>
        <!--<StackPanel>
        <local:FZTextBlock Text="Purchasable" 
                           Visibility="{Binding SelectedItem.PurchasableCar, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
        <local:FZTextBlock Text="Wheelspin" 
                           Visibility="{Binding SelectedItem.WheelspinPrizeCar, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
        <local:FZTextBlock Text="IsBarnFind" 
                           Visibility="{Binding SelectedItem.IsBarnFind, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
        <local:FZTextBlock Text="PerkCar" 
                           Visibility="{Binding SelectedItem.PerkCar, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
        <local:FZTextBlock Text="ThreadRewardCar" 
                           Visibility="{Binding SelectedItem.ThreadRewardCar, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
        <local:FZTextBlock Text="HouseRewardCar" 
                           Visibility="{Binding SelectedItem.HouseRewardCar, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>

        </StackPanel>-->
    </Grid>
</CarSelect>
