<Page DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Style="{StaticResource A_Style_Page_Generic}"
      mc:Ignorable="d"
      x:Class="ForzaUI.A_AuctionListings"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:Dynamic="clr-namespace:System.Dynamic;assembly=System.Core"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Page.Resources>
        <Style TargetType="ListBoxItem"
               x:Key="A_Style_ListBoxItem_AuctionListings">
            <Setter Property="Height"
                    Value="138" />
            <Setter Property="Margin"
                    Value="0,0,0,5" />
            <Setter Property="Template"
                    Value="{StaticResource A_ControlTemplate_TextMenu_HighlightStroke}" />
            <Setter Property="local:FocusOnMouseOverBehaviour.Self"
                    Value="True" />
        </Style>
        <Style BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_NotFocusable}"
               TargetType="ListBoxItem"
               x:Key="A_Style_ListBoxItem_AuctionListings_Empty">
            <Setter Property="Height"
                    Value="138" />
            <Setter Property="Margin"
                    Value="0,0,0,5" />
            <Setter Property="Focusable"
                    Value="False" />
        </Style>
        <DataTemplate x:Key="A_DataTemplate_EmptyItemStyle">
            <local:FZMaterial Color="{StaticResource A_Color_AuctionHouse_DisabledBackgroundGlass}"
                              Preset="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}" />
        </DataTemplate>
        <Style TargetType="local:FZTextBlock"
               x:Key="A_Style_FZTextBlock_Auction_CarDetail">
            <Setter Property="HorizontalAlignment"
                    Value="Left" />
            <Setter Property="LineAdjust"
                    Value="-0.35" />
            <Setter Property="VerticalAlignment"
                    Value="Top" />
            <Setter Property="StretchDirection"
                    Value="DownOnly" />
            <Setter Property="FontSize"
                    Value="31" />
            <Setter Property="Color"
                    Value="{StaticResource A_Color_AuctionHouse_PillDetailText}" />
            <Setter Property="TextWrapping"
                    Value="Wrap" />
            <Setter Property="TextAlignment"
                    Value="Left" />
        </Style>
        <Style BasedOn="{StaticResource A_Style_FZTextBlock_Auction_CarDetail}"
               TargetType="local:FZTextBlock"
               x:Key="A_Style_FZTextBlock_Auction_CarDetail_Item">
            <Style.Triggers>
                <DataTrigger Binding="{Binding NoActions}"
                             Value="True">
                    <Setter Property="Color"
                            Value="{StaticResource A_Color_AuctionHouse_NoActionsText}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="ContentControl"
               x:Key="A_Style_ContentControl_BidBox_Small">
            <Style.Resources>
                <System:Double x:Key="A_Double_BidBox_CreditIconSize">28</System:Double>
                <TextAlignment x:Key="A_TextAlignment_BidBox_Title">Right</TextAlignment>
            </Style.Resources>
            <Setter Property="Template"
                    Value="{StaticResource A_Template_ContentControl_BidBox}" />
        </Style>
        <Style TargetType="ContentControl"
               BasedOn="{StaticResource A_Style_ContentControl_BidBox_Small}"
               x:Key="A_Style_ContentControl_BidBox_Small_OnItem">
            <Style.Resources>
                <System:Double x:Key="A_Double_BidBox_CreditIconSize">28</System:Double>
                <TextAlignment x:Key="A_TextAlignment_BidBox_Title">Right</TextAlignment>
                <Style x:Key="A_Style_FZTextBlock_BidBoxTitle_Dynamic"
                       TargetType="{x:Type local:FZTextBlock}"
                       BasedOn="{StaticResource A_Style_FZTextBlock_BidBoxTitle_Default}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding NoActions}"
                                     Value="True">
                            <Setter Property="local:BindingProxy.A"
                                    Value="{StaticResource A_Color_AuctionHouse_NoActionsText}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Ended}"
                                     Value="True">
                            <Setter Property="local:BindingProxy.A"
                                    Value="{StaticResource A_Color_AuctionHouse_Expired}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
                <Style x:Key="A_Style_FZMaterial_BidBoxIcon_Dynamic"
                       TargetType="{x:Type local:FZMaterial}"
                       BasedOn="{StaticResource A_Style_FZMaterial_BidBoxIcon_Default}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding NoActions}"
                                     Value="True">
                            <Setter Property="local:BindingProxy.A"
                                    Value="{StaticResource A_Color_AuctionHouse_NoActionsText}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Ended}"
                                     Value="True">
                            <Setter Property="local:BindingProxy.A"
                                    Value="{StaticResource A_Color_AuctionHouse_Expired}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Style.Resources>
            <Setter Property="Template"
                    Value="{StaticResource A_Template_ContentControl_BidBox}" />
        </Style>
        <Style BasedOn="{StaticResource A_Style_ContentControl_BidBox_HighestBid}"
               TargetType="ContentControl"
               x:Key="A_Style_ContentControl_BidBox_Small_HighestBid">
            <Style.Resources>
                <System:Double x:Key="A_Double_BidBox_CreditIconSize">28</System:Double>
                <TextAlignment x:Key="A_TextAlignment_BidBox_Title">Right</TextAlignment>
            </Style.Resources>
        </Style>
        <Style BasedOn="{StaticResource A_Style_ContentControl_BidBox_Small_HighestBid}"
               TargetType="ContentControl"
               x:Key="A_Style_ContentControl_BidBox_Small_HighestBid_OnItem">
            <Style.Resources>
                <System:Double x:Key="A_Double_BidBox_CreditIconSize">28</System:Double>
                <TextAlignment x:Key="A_TextAlignment_BidBox_Title">Right</TextAlignment>
                <Style x:Key="A_Style_FZTextBlock_BidBoxTitle_Dynamic"
                       TargetType="{x:Type local:FZTextBlock}"
                       BasedOn="{StaticResource A_Style_FZTextBlock_BidBoxTitle_Default}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding NoActions}"
                                     Value="True">
                            <Setter Property="local:BindingProxy.A"
                                    Value="{StaticResource A_Color_AuctionHouse_NoActionsText}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Ended}"
                                     Value="True">
                            <Setter Property="local:BindingProxy.A"
                                    Value="{StaticResource A_Color_AuctionHouse_Expired}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
                <Style x:Key="A_Style_FZMaterial_BidBoxIcon_Dynamic"
                       TargetType="{x:Type local:FZMaterial}"
                       BasedOn="{StaticResource A_Style_FZMaterial_BidBoxIcon_Default}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding NoActions}"
                                     Value="True">
                            <Setter Property="local:BindingProxy.A"
                                    Value="{StaticResource A_Color_AuctionHouse_NoActionsText}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Ended}"
                                     Value="True">
                            <Setter Property="local:BindingProxy.A"
                                    Value="{StaticResource A_Color_AuctionHouse_Expired}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Style.Resources>
        </Style>
        <Style BasedOn="{StaticResource A_Style_ContentControl_BidBox_HighestBid}"
               TargetType="ContentControl"
               x:Key="A_Style_ContentControl_BidBox_Large_HighestBid">
            <Style.Resources>
                <System:Double x:Key="A_Double_BidBox_CreditIconSize">42</System:Double>
                <TextAlignment x:Key="A_TextAlignment_BidBox_Title">Right</TextAlignment>
            </Style.Resources>
        </Style>
        <Style TargetType="ContentControl"
               x:Key="A_Style_ContentControl_BidBox_Large">
            <Style.Resources>
                <System:Double x:Key="A_Double_BidBox_CreditIconSize">42</System:Double>
                <TextAlignment x:Key="A_TextAlignment_BidBox_Title">Right</TextAlignment>
            </Style.Resources>
            <Setter Property="Template"
                    Value="{StaticResource A_Template_ContentControl_BidBox}" />
        </Style>
        <Style TargetType="local:FZTextBlock"
               x:Key="A_Style_FZTextBlock_AuctionItem_TimeRemaining">
            <Setter Property="Text"
                    Value="{Binding TimeRemaining, Converter={StaticResource A_Converter_AuctionTime}}" />
            <Setter Property="FontFamily"
                    Value="Horizon_A" />
            <Setter Property="Height"
                    Value="16" />
            <Setter Property="Stretch"
                    Value="Uniform" />
            <Setter Property="StretchDirection"
                    Value="Both" />
            <Setter Property="VerticalAlignment"
                    Value="Center" />
            <Setter Property="Color"
                    Value="{StaticResource A_Color_AuctionHouse_TimeRemaining}" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Ended}"
                             Value="True">
                    <Setter Property="Color"
                            Value="{StaticResource A_Color_AuctionHouse_Expired}" />
                    <Setter Property="Text"
                            Value="{local:Loc AuctionHouse.IDS_Ended}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding NoActions}"
                             Value="True">
                    <Setter Property="Color"
                            Value="{StaticResource A_Color_AuctionHouse_NoActionsText}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="A_Style_FZMaterial_AuctionItemTimeRemaining"
               TargetType="{x:Type local:FZMaterial}">
            <Setter Property="Color"
                    Value="{StaticResource A_Color_AuctionHouse_TimeRemaining}" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Ended}"
                             Value="True">
                    <Setter Property="Color"
                            Value="{StaticResource A_Color_AuctionHouse_Expired}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding NoActions}"
                             Value="True">
                    <Setter Property="Color"
                            Value="{StaticResource A_Color_AuctionHouse_NoActionsText}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <local:LinearTransformConverter Add="1"
                                        Scale="-1"
                                        x:Key="A_InvertConverter" />
        <Style x:Key="A_Style_FZTextBlock_Auction_Pill_CreditValueText_CurrentBidPrice"
               BasedOn="{StaticResource A_Style_FZTextBlock_Auction_Pill_CreditValueText}"
               TargetType="local:FZTextBlock">
            <Setter Property="Color"
                    Value="{StaticResource A_Color_AuctionHouse_CurrentBidPrice}" />
        </Style>
        <Style x:Key="A_Style_FZTextBlock_Auction_Pill_CreditValueText_BuyOutPrice"
               BasedOn="{StaticResource A_Style_FZTextBlock_Auction_Pill_CreditValueText}"
               TargetType="local:FZTextBlock">
            <Setter Property="Color"
                    Value="{StaticResource A_Color_AuctionHouse_BuyOutPrice}" />
        </Style>
        <DataTemplate x:Key="A_DataTemplate_AuctionListings">
            <DataTemplate.Resources>
                <local:UIStoryboard x:Key="PART_Storyboard_BlendValueInputChanged">
                    <DoubleAnimationUsingKeyFrames FillBehavior="Stop"
                                                   Storyboard.TargetName="{x:Null}"
                                                   Storyboard.TargetProperty="(local:BlendValue.Blend)">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                                Value="0" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.36"
                                              Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                </local:UIStoryboard>
            </DataTemplate.Resources>
            <Grid IsHitTestVisible="False">
                <local:FZMaterial Color="{StaticResource A_Color_AuctionHouse_DisabledBackgroundGlass}"
                                  Preset="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}"
                                  Visibility="Collapsed"
                                  x:Name="BackgroundMaterial"
                                  Margin="-1" />
                <Grid Opacity="{Binding Path=(local:BlendValue.Output), RelativeSource={RelativeSource Self}, Converter={StaticResource A_InvertConverter}}"
                      local:BlendValue.Input="{Binding HasFailed}"
                      local:BlendValue.InputChangedStoryboard="{StaticResource PART_Storyboard_BlendValueInputChanged}">
                    <ProgressBar Height="56"
                                 HorizontalAlignment="Center"
                                 IsIndeterminate="True"
                                 Opacity="{Binding Path=(local:BlendValue.Output), RelativeSource={RelativeSource Self}, Converter={StaticResource A_InvertConverter}}"
                                 Style="{StaticResource A_Style_ProgressBar_WaitSpinnerDark}"
                                 VerticalAlignment="Center"
                                 local:BlendValue.Input="{Binding Loaded}"
                                 local:BlendValue.InputChangedStoryboard="{StaticResource PART_Storyboard_BlendValueInputChanged}"
                                 x:Name="Spinner" />
                </Grid>
                <DockPanel LastChildFill="True"
                           Opacity="{Binding Path=(local:BlendValue.Output), RelativeSource={RelativeSource Self}}"
                           local:BlendValue.Input="{Binding Loaded}"
                           local:BlendValue.InputChangedStoryboard="{StaticResource PART_Storyboard_BlendValueInputChanged}"
                           x:Name="Content">
                    <Grid DockPanel.Dock="Left">
                        <!-- Thumbnail -->
                        <local:FZMaterial Height="118"
                                          ImageSource="{Binding SmallThumbnail}"
                                          Margin="15"
                                          Stretch="Uniform"
                                          Width="201" />
                        <DockPanel VerticalAlignment="Top"
                                   Width="231">
                            <StackPanel Orientation="Horizontal"
                                        DockPanel.Dock="Right"
                                        VerticalAlignment="Top"
                                        Margin="6">
                                <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}"
                                                  Color="{StaticResource A_Color_AuctionHouse_CarInGarageBackground}"
                                                  Visibility="{Binding IsDLC, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/A_DLC.png"
                                                      Height="19"
                                                      Width="19"
                                                      Margin="5" />
                                </local:FZMaterial>
                                <Decorator Width="5" />
                                <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}"
                                                  Color="{StaticResource A_Color_AuctionHouse_CarInGarageBackground}"
                                                  Visibility="{Binding IsOwned, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/A_Garage.png"
                                                      Width="19"
                                                      Height="19"
                                                      Margin="5" />
                                </local:FZMaterial>
                            </StackPanel>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Auction_Banner}"
                                              VerticalAlignment="Stretch"
                                              HorizontalAlignment="Left"
                                              DockPanel.Dock="Left"
                                              Margin="6">
                                <Viewbox StretchDirection="DownOnly">
                                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Auction_Banner}"
                                                       Margin="9,7" />
                                </Viewbox>
                            </local:FZMaterial>
                        </DockPanel>
                    </Grid>
                    <local:FZMaterial Color="{StaticResource A_Color_AuctionHouse_ItemSeparator}"
                                      DockPanel.Dock="Left"
                                      Width="2"
                                      Margin="0,15" />
                    <Grid Margin="17">
                        <!-- Car info -->
                        <DockPanel>
                            <Grid DockPanel.Dock="Right"
                                        VerticalAlignment="Top"
                                        Margin="0,-11,-11,-11"
                                        MaxWidth="135">
                                <Control Style="{StaticResource A_Style_Control_AuctionHouse_RarityPill}"
                                         HorizontalAlignment="Right" />
                                <Control Style="{StaticResource A_Style_Control_AuctionHouse_BarnFindPill}"
                                         HorizontalAlignment="Right" />
                            </Grid>
                            <StackPanel Orientation="Vertical">
                                <local:FZTextBlock HorizontalAlignment="Stretch"
                                                   Style="{StaticResource A_Style_FZTextBlock_Auction_CarDetail_Item}">
                                    <local:FZRun Text="{Binding CarManufacturer, Converter={StaticResource A_StringToUpper}}" />
                                    <local:FZRun Text=" " />
                                    <local:FZRun FontFamily="Horizon_B"
                                                 Text="{Binding CarModel, Converter={StaticResource A_StringToUpper}}" />
                                </local:FZTextBlock>
                                <Decorator Height="5" />
                                <StackPanel Orientation="Horizontal">
                                    <local:FZTextBlock FontFamily="Horizon_B"
                                                       Style="{StaticResource A_Style_FZTextBlock_Auction_CarDetail_Item}"
                                                       Text="{Binding CarYear}"
                                                       VerticalAlignment="Center" />
                                    <Decorator Width="10" />
                                    <Control Height="25"
                                             Style="{StaticResource A_Style_Control_CarClassBadge_Small}"
                                             local:BindingProxy.A="{Binding CarPI}"
                                             local:BindingProxy.B="{Binding CarClass}" />
                                </StackPanel>
                            </StackPanel>
                        </DockPanel>
                        <!-- Time remaining -->
                        <StackPanel HorizontalAlignment="Left"
                                    Margin="0,-2"
                                    Orientation="Horizontal"
                                    VerticalAlignment="Bottom">
                            <local:FZMaterial Height="18"
                                              ImageSource="/ForzaUI;component/Textures/Anthem/Icons/TinyGavel.png"
                                              Style="{StaticResource A_Style_FZMaterial_AuctionItemTimeRemaining}"
                                              VerticalAlignment="Center"
                                              Width="18" />
                            <Decorator Width="10" />
                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_AuctionItem_TimeRemaining}" />
                        </StackPanel>
                        <!-- Costs -->
                        <StackPanel HorizontalAlignment="Right"
                                    Orientation="Horizontal"
                                    VerticalAlignment="Bottom">
                            <!-- Bid -->
                            <ContentControl Style="{StaticResource A_Style_ContentControl_BidBox_Small_HighestBid_OnItem}"
                                            local:BindingProxy.B="{StaticResource A_Color_AuctionHouse_CurrentBidPrice}">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Auction_Pill_CreditValueText_CurrentBidPrice}"
                                                   Text="{Binding HighestBid, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}" />
                            </ContentControl>
                            <Decorator Width="15" />
                            <!-- Buyout -->
                            <ContentControl Style="{StaticResource A_Style_ContentControl_BidBox_Small_OnItem}"
                                            Tag="{Binding Source={local:Loc AuctionHouse.IDS_AuctionHouseDetails_Buyout}, Converter={StaticResource A_StringToUpper}, Mode=OneWay }"
                                            local:BindingProxy.B="{StaticResource A_Color_AuctionHouse_BuyOutPrice}">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Auction_Pill_CreditValueText_BuyOutPrice}"
                                                   Text="{Binding Buyout, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}" />
                            </ContentControl>
                        </StackPanel>
                    </Grid>
                </DockPanel>
                <local:FZMaterial Width="56"
                                  Height="56"
                                  Color="#55000000"
                                  Opacity="{Binding Path=(local:BlendValue.Output), RelativeSource={RelativeSource Self}}"
                                  HorizontalAlignment="Center"
                                  VerticalAlignment="Center"
                                  local:BlendValue.Input="{Binding HasFailed}"
                                  local:BlendValue.InputChangedStoryboard="{StaticResource PART_Storyboard_BlendValueInputChanged}"
                                  ImageSource="/ForzaUI;component/Textures/Anthem/Icons/Cross.png" />
            </Grid>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding NoActions}"
                             Value="True">
                    <Setter Property="Visibility"
                            TargetName="BackgroundMaterial"
                            Value="Visible" />
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
        <Style BasedOn="{StaticResource A_Style_FZMaterial_AcrylicPanel_BodyPanel_Alt}"
               TargetType="local:FZMaterial"
               x:Key="A_Style_FZMaterial_AuctionListArrowBackground">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=(local:BindingProxy.A), RelativeSource={RelativeSource Self}}"
                             Value="True">
                    <Setter Property="Preset"
                            Value="{StaticResource A_FZMaterialPresetAcrylicPanel_EmptyItem}" />
                    <Setter Property="Color"
                            Value="{StaticResource A_Color_Acrylic_Tile_EmptyItem}" />
                </DataTrigger>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding IsPC, RelativeSource={RelativeSource AncestorType=Page}}"
                                   Value="True" />
                        <Condition Binding="{Binding Path=(local:BindingProxy.A), RelativeSource={RelativeSource Self}}"
                                   Value="False" />
                    </MultiDataTrigger.Conditions>
                    <Setter Property="Preset"
                            Value="{StaticResource A_FZMaterialPresetAcrylicPanel_Opaque}" />
                    <Setter Property="Color"
                            Value="{StaticResource A_Color_Acrylic_Tile_Background}" />
                </MultiDataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="A_Style_Control_AuctionListArrowMouseRolloverTop"
               TargetType="Control"
               BasedOn="{StaticResource A_Style_Control_MouseRollover}">
            <Style.Triggers>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding Path=(local:FZScrollViewer.IsAtTop), ElementName=ItemList}"
                                   Value="False" />
                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=local:FZMaterial}}"
                                   Value="True" />
                    </MultiDataTrigger.Conditions>
                    <Setter Property="Visibility"
                            Value="Visible" />
                </MultiDataTrigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="A_Style_Control_AuctionListArrowMouseRolloverBottom"
               TargetType="Control">
            <Style.Triggers>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding Path=(local:FZScrollViewer.IsAtBottom), ElementName=ItemList}"
                                   Value="False" />
                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=local:FZMaterial}}"
                                   Value="True" />
                    </MultiDataTrigger.Conditions>
                    <Setter Property="Visibility"
                            Value="Visible" />
                </MultiDataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="FrameworkElement"
               x:Key="A_Style_FrameworkElement_HasResults">
            <Setter Property="Visibility"
                    Value="Hidden" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Collection.CountState}"
                             Value="{x:Static local:AsyncItemsCountState.Results}">
                    <DataTrigger.Setters>
                        <Setter Property="Visibility"
                                Value="Visible" />
                    </DataTrigger.Setters>
                </DataTrigger>
                <DataTrigger Binding="{Binding SelectedItem.HasFailed, ElementName=ItemList}"
                             Value="True">
                    <DataTrigger.Setters>
                        <Setter Property="Visibility"
                                Value="Hidden" />
                    </DataTrigger.Setters>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="FrameworkElement"
               x:Key="A_Style_FrameworkElement_NoItemsYet">
            <Setter Property="Visibility"
                    Value="Visible" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Collection.CountState}"
                             Value="{x:Static local:AsyncItemsCountState.Results}">
                    <DataTrigger.Setters>
                        <Setter Property="Visibility"
                                Value="Hidden" />
                    </DataTrigger.Setters>
                </DataTrigger>
                <DataTrigger Binding="{Binding SelectedItem.HasFailed, ElementName=ItemList}"
                             Value="True">
                    <DataTrigger.Setters>
                        <Setter Property="Visibility"
                                Value="Visible" />
                    </DataTrigger.Setters>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="FrameworkElement"
               x:Key="A_Style_FrameworkElement_Loading">
            <Setter Property="Visibility"
                    Value="Hidden" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Collection.CountState}"
                             Value="{x:Static local:AsyncItemsCountState.Loading}">
                    <DataTrigger.Setters>
                        <Setter Property="Visibility"
                                Value="Visible" />
                    </DataTrigger.Setters>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}"
               TargetType="local:FZTextBlock"
               x:Key="A_Style_FZTextBlock_NoResultsText">
            <Setter Property="Visibility"
                    Value="Visible" />
            <Setter Property="TextWrapping"
                    Value="Wrap" />
            <Setter Property="Text"
                    Value="{local:Loc AuctionHouse.IDS_NoResults}" />
            <Setter Property="Margin"
                    Value="100,0" />
            <Setter Property="FontSize"
                    Value="42" />
            <Setter Property="TextAlignment"
                    Value="Center" />
            <Setter Property="Color"
                    Value="{StaticResource A_Color_SubHeader_Text}" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Collection.CountState}"
                             Value="{x:Static local:AsyncItemsCountState.Loading}">
                    <DataTrigger.Setters>
                        <Setter Property="Visibility"
                                Value="Hidden" />
                    </DataTrigger.Setters>
                </DataTrigger>
                <DataTrigger Binding="{Binding Collection.CountState}"
                             Value="{x:Static local:AsyncItemsCountState.Error}">
                    <DataTrigger.Setters>
                        <Setter Property="Text"
                                Value="{Binding Collection.ErrorString, Converter={StaticResource A_StringToUpper}}" />
                    </DataTrigger.Setters>
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=SelectedItem.HasFailed, ElementName=ItemList}"
                             Value="True">
                    <DataTrigger.Setters>
                        <Setter Property="Text"
                                Value="{Binding Path=SelectedItem.ErrorString, ElementName=ItemList, Converter={StaticResource A_StringToUpper}}" />
                        <Setter Property="Visibility"
                                Value="Visible" />
                    </DataTrigger.Setters> 
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Page.Resources>
    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Menu}" />
    </local:UIPageTransitionManager.TransitionManager>
    <Grid x:Name="LayoutRoot">
       <Control Style="{StaticResource A_Style_Control_ScreenBackground}" />
        <!-- Bars -->
        <local:PlayerBarControl Style="{StaticResource A_Style_PlayerBarControl}"
                                x:Name="TopBar" />
        <ContentControl Style="{StaticResource A_Style_ButtonBar}"
                        x:Name="BottomBar">
            <ContentControl Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}"
                            local:ControllerButtonPanel.BDescription="{local:Loc HelpButtons.IDS_Back}"
                            x:Name="DefaultHelpPanel" />
        </ContentControl>
        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <local:RoutedEventCommand x:Name="ItemListPageDown"
                                      RoutedEvent="UIElement.MouseLeftButtonUp"
                                      Command="{Binding ScrollPageNextCommand, ElementName=ItemList}" />
            <local:RoutedEventCommand x:Name="ItemListPageUp"
                                      RoutedEvent="UIElement.MouseLeftButtonUp"
                                      Command="{Binding ScrollPagePrevCommand, ElementName=ItemList}" />

            <StackPanel HorizontalAlignment="Center"
                        Margin="0,0,0,0"
                        Orientation="Vertical"
                        VerticalAlignment="Center">
                <Decorator HorizontalAlignment="Left"
                           Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                    <ContentControl Content="{local:Loc ScreenTitles.IDS_AuctionHouse}"
                                    Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                    Tag="{Binding Subtitle}"
                                    local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/AuctionHouse.png" />
                </Decorator>
                <!-- Content -->
                <StackPanel Orientation="Horizontal">
                    <Grid Panel.ZIndex="1"
                          Width="830">
                        <!-- List -->
                        <Grid KeyboardNavigation.DirectionalNavigation="Contained"
                              Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_3}">
                            <DockPanel LastChildFill="True">
                                <ContentControl Style="{StaticResource A_Style_ContentControl_ScrollArrowBox}"
                                                DockPanel.Dock="Top"
                                                Margin="0,0,0,5"
                                                local:BindingProxy.A="{Binding Path=(local:FZScrollViewer.IsAtTop), ElementName=ItemList}"
                                                local:RoutedEventCommand.Action="{Binding ElementName=ItemListPageUp}">
                                    <local:FZMaterial RenderTransformOrigin="0.5,0.5"
                                                      Style="{StaticResource A_Style_FZMaterial_ScrollArrow_TextMenu}">
                                        <local:FZMaterial.RenderTransform>
                                            <RotateTransform Angle="180" />
                                        </local:FZMaterial.RenderTransform>
                                    </local:FZMaterial>
                                </ContentControl>
                                <ContentControl Style="{StaticResource A_Style_ContentControl_ScrollArrowBox}"
                                                DockPanel.Dock="Bottom"
                                                local:BindingProxy.A="{Binding Path=(local:FZScrollViewer.IsAtBottom), ElementName=ItemList}"
                                                local:RoutedEventCommand.Action="{Binding ElementName=ItemListPageDown}">
                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_ScrollArrow_TextMenu}" />
                                </ContentControl>
                                <Grid Height="572">
                                    <local:CommonListBox ItemContainerStyle="{StaticResource A_Style_ListBoxItem_AuctionListings_Empty}"
                                                         ItemTemplate="{StaticResource A_DataTemplate_EmptyItemStyle}"
                                                         SelectedIndex="1"
                                                         Style="{StaticResource A_Style_ListBox_TextMenu_Default}"
                                                         local:ZPanel.SortByDepth="True">
                                        <Control Focusable="False" />
                                        <Control Focusable="False" />
                                        <Control Focusable="False" />
                                        <Control Focusable="False" />
                                    </local:CommonListBox>
                                    <local:CommonListBox ItemContainerStyle="{StaticResource A_Style_ListBoxItem_AuctionListings}"
                                                         ItemTemplate="{StaticResource A_DataTemplate_AuctionListings}"
                                                         ItemsSource="{Binding Collection}"
                                                         ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                                         Style="{StaticResource A_Style_ListBox_TextMenu_Default}"
                                                         local:FocusOnPageFocusGained.SelectorSelectedItem="True"
                                                         x:Name="ItemList"
                                                         SelectedIndex="0"
                                                         PageSize="1" />
                                </Grid>
                            </DockPanel>
                        </Grid>
                    </Grid>
                    <Decorator Width="5" />
                    <Decorator Width="875">
                        <Grid>
                            <Grid Style="{StaticResource A_Style_FrameworkElement_HasResults}">
                                <DockPanel DataContext="{Binding SelectedItem, ElementName=ItemList}"
                                           LastChildFill="True">
                                    <!-- Detail panel -->
                                    <Grid DockPanel.Dock="Bottom"
                                          Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_2}">
                                        <local:FZMaterial Height="118"
                                                          HorizontalAlignment="Stretch"
                                                          Style="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}">
                                            <Grid Margin="5">
                                                <!-- High bidder -->
                                                <Control HorizontalAlignment="Left"
                                                         Style="{StaticResource A_Style_Control_Auction_HighestBidder_Dark}"
                                                         local:BindingProxy.A="{StaticResource A_Color_AuctionHouse_PillDetailText}"
                                                         local:BindingProxy.B="{StaticResource A_Color_AuctionHouse_Expired}" />
                                                <Grid Margin="11">
                                                    <!-- Costs -->
                                                    <StackPanel HorizontalAlignment="Right"
                                                                Orientation="Horizontal"
                                                                VerticalAlignment="Top">
                                                        <!-- Bid -->
                                                        <ContentControl Style="{StaticResource A_Style_ContentControl_BidBox_Small_HighestBid}"
                                                                        local:BindingProxy.A="{StaticResource A_Color_AuctionHouse_PillDetailText}"
                                                                        local:BindingProxy.B="{StaticResource A_Color_AuctionHouse_CurrentBidPrice}">
                                                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Auction_Pill_CreditValueText}"
                                                                               Text="{Binding HighestBid, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                                                               Color="{StaticResource A_Color_AuctionHouse_CurrentBidPrice}" />
                                                        </ContentControl>
                                                        <Decorator Width="24" />
                                                        <!-- Buyout -->
                                                        <ContentControl Style="{StaticResource A_Style_ContentControl_BidBox_Small}"
                                                                        Tag="{Binding Source={local:Loc AuctionHouse.IDS_AuctionHouseDetails_Buyout}, Converter={StaticResource A_StringToUpper}, Mode=OneWay }"
                                                                        local:BindingProxy.A="{StaticResource A_Color_AuctionHouse_PillDetailText}"
                                                                        local:BindingProxy.B="{StaticResource A_Color_AuctionHouse_BuyOutPrice}">
                                                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Auction_Pill_CreditValueText}"
                                                                               Text="{Binding Buyout, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                                                               Color="{StaticResource A_Color_AuctionHouse_BuyOutPrice}" />
                                                        </ContentControl>
                                                    </StackPanel>
                                                    <!-- Time remaining -->
                                                    <Control HorizontalAlignment="Right"
                                                             Template="{StaticResource A_ControlTemplate_AuctionDetails_TimeRemaining}"
                                                             VerticalAlignment="Bottom" />
                                                </Grid>
                                            </Grid>
                                        </local:FZMaterial>
                                    </Grid>
                                    <Decorator DockPanel.Dock="Bottom"
                                               Height="5" />
                                    <ContentControl Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_2}"
                                                    Tag="{local:Loc AuctionHouse.IDS_AuctionDetails}"
                                                    Template="{StaticResource A_ControlTemplate_SidePanel}">
                                        <Grid Margin="30"
                                              Visibility="{Binding Loaded, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden}, FallbackValue=Hidden}">
                                            <!-- Thumbnail -->
                                            <local:FZMaterial GreedyMeasure="True"
                                                              HorizontalAlignment="Left"
                                                              ImageSource="{Binding LargeThumbnail}"
                                                              Margin="-30"
                                                              Stretch="Uniform"
                                                              VerticalAlignment="Bottom"
                                                              Width="620" />
                                            <!-- Car info -->
                                            <StackPanel HorizontalAlignment="Left"
                                                        Orientation="Vertical"
                                                        VerticalAlignment="Top">
                                                <local:FZTextBlock Color="{StaticResource A_Color_SubHeader_Text}"
                                                                   FontSize="51"
                                                                   HorizontalAlignment="Stretch"
                                                                   LineAdjust="-0.35"
                                                                   Style="{StaticResource A_Style_FZTextBlock_Auction_CarDetail}">
                                                    <local:FZRun Text="{Binding CarManufacturer, Converter={StaticResource A_StringToUpper}}" />
                                                    <local:FZRun Text=" " />
                                                    <local:FZRun FontFamily="Horizon_B"
                                                                 Text="{Binding CarModel, Converter={StaticResource A_StringToUpper}}" />
                                                </local:FZTextBlock>
                                                <Decorator Height="11" />
                                                <StackPanel Orientation="Horizontal">
                                                    <local:FZTextBlock Color="{StaticResource A_Color_SubHeader_Text}"
                                                                       FontFamily="Horizon_B"
                                                                       FontSize="51"
                                                                       Style="{StaticResource A_Style_FZTextBlock_Auction_CarDetail}"
                                                                       Text="{Binding CarYear}"
                                                                       VerticalAlignment="Center" />
                                                    <Decorator Width="10" />
                                                    <Control Height="36"
                                                             Style="{StaticResource A_Style_Control_CarClassBadge_Small}"
                                                             local:BindingProxy.A="{Binding CarPI}"
                                                             local:BindingProxy.B="{Binding CarClass}" />
                                                </StackPanel>
                                                <Decorator Height="15" />
                                                <Control Style="{StaticResource A_Style_Control_AuctionHouse_RarityPillWithHEBonus}"
                                                         HorizontalAlignment="Left"
                                                         Height="33"
                                                         Margin="0,4,0,0" />
                                                <Control Style="{StaticResource A_Style_Control_AuctionHouse_BarnFindPill}"
                                                         HorizontalAlignment="Left"
                                                         Height="33"
                                                         Margin="0,4,0,0" />
                                            </StackPanel>
                                            <!-- Collaborators info -->
                                            <StackPanel HorizontalAlignment="Right"
                                                        Orientation="Vertical"
                                                        VerticalAlignment="Bottom">
                                                <!-- Seller -->
                                                <local:FZTextBlock Color="{StaticResource A_Color_SubHeader_Text}"
                                                                   FontFamily="Horizon_A"
                                                                   Height="16"
                                                                   Stretch="Uniform"
                                                                   StretchDirection="Both"
                                                                   Text="{local:Loc AuctionHouse.IDS_Seller}"
                                                                   TextAlignment="Right" />
                                                <Decorator Height="11" />
                                                <Control DataContext="{Binding Seller}"
                                                         Height="22"
                                                         HorizontalAlignment="Right"
                                                         Template="{StaticResource A_Template_ClubAndGamertag}" />
                                                <!-- Painter -->
                                                <StackPanel>
                                                    <Decorator Height="23" />

                                                    <Control HorizontalContentAlignment="Right"
                                                             Template="{StaticResource A_Template_Control_Auction_Collaborator}"
                                                             local:BindingProxy.A="{Binding Painter}"
                                                             local:BindingProxy.B="{x:Static local:UGCThreadType.Vinyl}"
                                                             local:BindingProxy.C="{local:Loc AuctionHouse.IDS_Paint}"
                                                             Tag="{Binding VinylGroupContributors}" />
                                                </StackPanel>
                                                <!-- Tuner -->
                                                <StackPanel>
                                                    <Decorator Height="23" />
                                                    <Control HorizontalContentAlignment="Right"
                                                             Template="{StaticResource A_Template_Control_Auction_Collaborator}"
                                                             local:BindingProxy.A="{Binding Tuner}"
                                                             local:BindingProxy.B="{x:Static local:UGCThreadType.Tuning}"
                                                             local:BindingProxy.C="{local:Loc AuctionHouse.IDS_Tune}"/>
                                                </StackPanel>
                                                <!-- Status -->
                                                <Grid Margin="0,14,0,0">
                                                    <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangleStroke_AuctionHouse_CurrentBidNotSet}"
                                                                      Color="{StaticResource A_Color_AuctionHouse_BidNow_Light}"
                                                                      Visibility="{Binding State, Converter={StaticResource A_Converter_BidNowPill}}">
                                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Auction_Banner}"
                                                                           Text="{Binding Source={local:Loc AuctionHouse.IDS_BidNow}, Converter={StaticResource A_StringToUpper}}"
                                                                           local:BindingProxy.C="{StaticResource A_Color_AuctionHouse_BidNow_Light}"
                                                                           CapHeight="18"
                                                                           Margin="9,7" />
                                                    </local:FZMaterial>
                                                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Auction_Banner}"
                                                                      VerticalAlignment="Top"
                                                                      HorizontalAlignment="Stretch"
                                                                      Height="48"
                                                                      MinWidth="220">
                                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Auction_Banner}"
                                                                           CapHeight="18"
                                                                           Margin="9,7" />
                                                    </local:FZMaterial>
                                                </Grid>
                                            </StackPanel>
                                        </Grid>
                                    </ContentControl>
                                </DockPanel>
                            </Grid>
                            <Grid Margin="0,0,0,-1"
                                  Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_2}">
                                <local:FZMaterial Style="{StaticResource A_Style_FrameworkElement_NoItemsYet}"
                                                  Color="{StaticResource A_Color_AuctionHouse_DisabledBackgroundGlass}"
                                                  Preset="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}">
                                    <Grid>
                                        <Grid Style="{StaticResource A_Style_FrameworkElement_Loading}">
                                            <ProgressBar Height="56"
                                                         HorizontalAlignment="Center"
                                                         IsIndeterminate="True"
                                                         Style="{StaticResource A_Style_ProgressBar_WaitSpinner}"
                                                         VerticalAlignment="Center"
                                                         x:Name="Spinner" />
                                        </Grid>
                                        <StackPanel HorizontalAlignment="Center"
                                                    VerticalAlignment="Center">
                                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_NoResultsText}" />
                                            <Decorator Height="15" />
                                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_NoResultsText}"
                                                               Text="{local:Loc AuctionHouse.IDS_PleaseTryAgainLater}"
                                                               FontFamily="Horizon_B" />
                                        </StackPanel>
                                    </Grid>
                                </local:FZMaterial>
                            </Grid>
                        </Grid>
                    </Decorator>
                </StackPanel>
            </StackPanel>
        </Grid>
    </Grid>
</Page>
