<Page xmlns:local="clr-namespace:ForzaUI"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      x:Class="ForzaUI.A_ContentHighlightSheet"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Margin="0">
    <Page.Resources>
        <ResourceDictionary>
            <Style x:Key="A_Style_Icon" TargetType="local:FZMaterial">
                <Setter Property="Width" Value="68"/>
                <Setter Property="Height" Value="68"/>
                <Setter Property="Stretch" Value="Uniform"/>
            </Style>

            <Color x:Key="A_Color_Car_Pack">#FFFFFF00</Color>

            <!---TEXT Styles-->
            <!--Seasonal Events Control. Use uppercase because converter used puts all text in uppercase-->
            <Style x:Key="A_Style_FZRun_BOLD" TargetType="local:FZRun">
                <Setter Property="FontFamily" Value="Horizon_A" />
            </Style>
            <Style x:Key="A_Style_FZRun_HorizonC_BOLD" TargetType="local:FZRun">
                <Setter Property="FontFamily" Value="Horizon_C" />
            </Style>
            <Style x:Key="A_Style_FZTextBlock_ContentHighlightSheetText" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="Color" Value="{StaticResource A_Color_White}"/>
                <Setter Property="FontSize" Value="24"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_ContentHighlightSheet_Subtitle_Base" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ContentHighlightSheetText}">
                <Setter Property="TextAlignment" Value="Center"/>
                <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_"/>
                <Setter Property="CapHeight" Value="76"/>
                <Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
                <Setter Property="LineHeight" Value="86"/>
                <Setter Property="FontFamily" Value="Horizon_A"/>
                <Setter Property="MaxHeight" Value="150"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_ContentHighlightSheet_Subtitle_Default" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ContentHighlightSheet_Subtitle_Base}">
                <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{Binding ScreenTitle, Converter={StaticResource A_StringToUpper}}"/>
                <Setter Property="CapHeight" Value="36"/>
                <Setter Property="LineHeight" Value="50"/>
                <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{Binding DLCAvailability}"/>
                <Setter Property="FontFamily" Value="Horizon_B"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_ContentHighlightSheet_Title_Base" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ContentHighlightSheetText}">
                <Setter Property="TextAlignment" Value="Center"/>
                <Setter Property="CapHeight" Value="36"/>
                <Setter Property="FontFamily" Value="Horizon_B"/>
                <Setter Property="Visibility" Value="Collapsed"/>
                <Setter Property="Margin" Value="0,12,0,0"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_ContentHighlightSheet_Title_Large" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ContentHighlightSheet_Title_Base}">
                <Setter Property="FontFamily" Value="Horizon_A"/>
                <Setter Property="CapHeight" Value="92"/>
            </Style>
            <Style x:Key="A_Style_FZTextBlock_ContentHighlightSheet_Title_Colored" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ContentHighlightSheet_Title_Large}">
                <Setter Property="Visibility" Value="Visible"/>
                <Setter Property="Text" Value="{Binding ScreenTitle}"/>
                <Setter Property="Color" Value="{StaticResource A_Color_Car_Pack}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding OverrideSheetPrimaryColor, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="{StaticResource A_Boolean_True}">
                        <Setter Property="Color" Value="{Binding OverrideSheetPrimaryColor}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            
            <Style x:Key="A_Style_FZTextBlock_ContentHighlightSheet_Description" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ContentHighlightSheetText}">
                <Setter Property="FontSize" Value="29"/>
                <Setter Property="FontFamily" Value="Horizon_D"/>
                <Setter Property="TextAlignment" Value="Center"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
                <Setter Property="MaxHeight" Value="124"/>
                <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_HorizonC_"/>
                <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{Binding ScreenDescription}"/>
                <Setter Property="Margin" Value="78,0,78,0"/>
            </Style>
            
            <Style x:Key="A_Style_FZTextBlock_ContentHighlightSheet_ItemTitle" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ContentHighlightSheetText}">
                <Setter Property="FontSize" Value="42"/>
                <Setter Property="FontFamily" Value="Horizon_B"/>
                <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_"/>
            </Style>
            <Style x:Key="A_Style_FZTextBlock_ContentHighlightSheet_ItemDescription" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_ContentHighlightSheetText}">
                <Setter Property="CapHeight" Value="15"/>
                <Setter Property="FontFamily" Value="Horizon_D"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
                <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_"/>
            </Style>
            
            <!-- Material Styles-->
            <Style x:Key="A_Style_FZMaterial_ColorBar" TargetType="local:FZMaterial">
                <Setter Property="Visibility" Value="Visible"/>
                <Setter Property="Color" Value="{StaticResource A_Color_Car_Pack}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding OverrideSheetPrimaryColor, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="{StaticResource A_Boolean_True}">
                        <Setter Property="Color" Value="{Binding OverrideSheetPrimaryColor}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            
            <DataTemplate DataType="{x:Type local:HighlightItem}">
                <DockPanel Width="700" Height="108" Margin="0,38,0,0" HorizontalAlignment="Left">
                    <StackPanel DockPanel.Dock="Right" Width="426" Height="86" VerticalAlignment="Bottom" Margin="0,0,40,0" HorizontalAlignment="Left">
                        <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding Title}" VerticalAlignment="Top" Style="{StaticResource A_Style_FZTextBlock_ContentHighlightSheet_ItemTitle}"/>
                        <Decorator VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="0,16,0,0" MaxHeight="48" >
                            <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding Description}" VerticalAlignment="Center" Style="{StaticResource A_Style_FZTextBlock_ContentHighlightSheet_ItemDescription}"/>
                        </Decorator>
                    </StackPanel>
                    <local:FZMaterial ImageSource="{Binding Thumbnail}" VerticalAlignment="Center"  Width="224" Height="126" Stretch="Uniform" />
                </DockPanel>
            </DataTemplate>

            <!-- Container Style-->
            <Style x:Key="A_Style_ListBoxItem_ContentHighlightSheetMenu" TargetType="ListBoxItem">
                <Setter Property="Focusable" Value="False" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                                <ContentPresenter />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- Create custom Scroll viewer to support arrows around our scrolling. -->
            <Style TargetType="local:FZMaterial" x:Key="A_Style_FZMaterial_Arrow_Visibility_Base">
                <Setter Property="Opacity" Value="1"/>
                <Setter Property="Width" Value="18"/>
                <Setter Property="Height" Value="9"/>
                <Setter Property="Data" Value="{StaticResource A_Geometry_SpinnerArrow}" />
            </Style>
            <Style x:Key="A_Style_FZMaterial_Arrow_Top" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_Arrow_Visibility_Base}">
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <ScaleTransform ScaleY="-1" />
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:FZScrollViewer}}, Path=(local:FZScrollViewer.IsAtTop)}" Value="True">
                        <Setter Property="Opacity" Value="0.5"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="A_Style_FZMaterial_Arrow_Bottom" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_Arrow_Visibility_Base}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:FZScrollViewer}}, Path=(local:FZScrollViewer.IsAtBottom)}" Value="True">
                        <Setter Property="Opacity" Value="0.5"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <ControlTemplate x:Key="A_Style_ContentHighlightSheet_FZScrollViewer" TargetType="{x:Type local:FZScrollViewer}">
                <Grid>
                    <ContentControl Style="{StaticResource A_ContentControl_HorizontalFadeViewer}">
                            <ScrollContentPresenter HorizontalAlignment="Right" CanContentScroll="True"/>
                    </ContentControl>
                    <Grid>
                        <local:FZMaterial x:Name="ScrollUpArrow" Margin="0,-10,0,0" VerticalAlignment="Top"
                                      Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                      Style="{StaticResource A_Style_FZMaterial_Arrow_Top}"/>
                        <ScrollBar x:Name="PART_VerticalScrollBar"
                                Background="{StaticResource A_Brush_ScrollBarBackground}"
                                Foreground="{StaticResource A_Brush_ScrollBarForeground}"
                                HorizontalAlignment="Right"
                                Minimum="0" 
                                Maximum="{TemplateBinding ScrollableHeight}" 
                                ViewportSize="{TemplateBinding ViewportHeight}" 
                                Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" 
                                Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" 
                                Margin="0, 0, -25, 0"
                                Style="{StaticResource A_Style_ScrollBar_Default}"/>
                        <local:FZMaterial x:Name="ScrollDownArrow" Margin="0,0,0,-20" VerticalAlignment="Bottom"
                                      Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                      Style="{StaticResource A_Style_FZMaterial_Arrow_Bottom}"/>
                    </Grid>
                </Grid>
            </ControlTemplate>

            <Style x:Key="A_Style_FZMaterial_Background_sheet" TargetType="local:FZMaterial">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Data_Bound/SellSheet/Content_BG.png"/>
                <Setter Property="Width" Value="700"/>
            </Style>

            <Style x:Key="A_Style_Listbox_SellingItems" TargetType="local:CommonListBox">
                <Setter Property="MaxHeight" Value="496"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="local:CommonListBox">
                            <Grid ClipToBounds="False">
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Background_sheet}"/>
                                <local:FZScrollViewer
                                                Template="{StaticResource A_Style_ContentHighlightSheet_FZScrollViewer}"
                                                VerticalScrollBarVisibility="Auto"
                                                CanContentScroll="True"
                                                KeepSelectionOnScreen="False" Margin="0,3">
                                    <StackPanel Orientation="Vertical" IsItemsHost="True" 
                                                    Margin="0,0,0,52" 
                                                    Focusable="False"/>
                                </local:FZScrollViewer>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="ItemContainerStyle" Value="{StaticResource A_Style_ListBoxItem_ContentHighlightSheetMenu}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=Items.Count}" Value="0">
                        <Setter Property="Visibility" Value="Collapsed" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_Decorator_ContentHighlight_Subtitle" TargetType="Decorator">
                <Setter Property="Visibility" Value="Visible"/>
                <Setter Property="MaxWidth" Value="740"/>
                <Setter Property="LayoutTransform" Value="{StaticResource A_Transform_Italic}"/>
            </Style>
            <Style x:Key="A_Style_Decorator_ContentHighlight_Title" TargetType="Decorator" BasedOn="{StaticResource A_Style_Decorator_ContentHighlight_Subtitle}"/>

            <Style x:Key="A_Style_Decorator_ContentHighlight_Subtitle_CHS" TargetType="Decorator" BasedOn="{StaticResource A_Style_Decorator_ContentHighlight_Subtitle}">
                <Setter Property="Margin" Value="0,0,0,20"/>
            </Style>
            <Style x:Key="A_Style_Decorator_ContentHighlight_Subtitle_JP" TargetType="Decorator" BasedOn="{StaticResource A_Style_Decorator_ContentHighlight_Subtitle}">
                <Setter Property="Margin" Value="0,0,0,16"/>
            </Style>
            <Style x:Key="A_Style_Decorator_ContentHighlight_Subtitle_CHT" TargetType="Decorator" BasedOn="{StaticResource A_Style_Decorator_ContentHighlight_Subtitle}">
                <Setter Property="Margin" Value="0,0,0,20"/>
            </Style>
            <Style x:Key="A_Style_Decorator_ContentHighlight_Subtitle_KO" TargetType="Decorator" BasedOn="{StaticResource A_Style_Decorator_ContentHighlight_Subtitle}">
                <Setter Property="Margin" Value="0,0,0,16"/>
            </Style>

        </ResourceDictionary>
    </Page.Resources>

    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Menu}"/>
    </local:UIPageTransitionManager.TransitionManager>
    <Grid>
        <Grid x:Name="LayoutRoot" Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <Border ClipToBounds="false">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}"
                  ClipToBounds="false">

                    <!--Background Image/video-->
                    <local:FZMaterial ImageSource="{Binding ScreenBackground}" Stretch="UniformToFill"
                                  Visibility="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />

                    <!--Text and image Content resting layer -->
                    <StackPanel Orientation="Horizontal">
                        <local:FZMaterial HorizontalAlignment="Left" Width="12" Style="{StaticResource A_Style_FZMaterial_ColorBar}"/>
                        <Decorator>
                            <Grid Width="936">
                                <local:FZMaterial Width="936" Color="#9A000000"/>
                                <Grid>
                                    <local:FZMaterialGlassCapture />
                                    <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                                        <Decorator Height="496"
                                                   DockPanel.Dock="Bottom" 
                                                   VerticalAlignment="Top"
                                                   Margin="0,0,0,148">
                                            <StackPanel Orientation="Vertical" VerticalAlignment="Center" >
                                                <local:CommonListBox x:Name="PART_CommonListBox_ContentHighlightSheetList"
                                                 ItemsSource="{Binding Items}"
                                                 HorizontalAlignment="Center"
                                                 Style="{StaticResource A_Style_Listbox_SellingItems}"/>
                                            </StackPanel>
                                        </Decorator>
                                        <StackPanel Orientation="Vertical" DockPanel.Dock="Top" Margin="0,104,0,0">
                                            <StackPanel Orientation="Vertical">
                                                <StackPanel Orientation="Vertical" MaxHeight="180">
                                                    <Decorator Style="{local:LocalizedResource A_Style_Decorator_ContentHighlight_Subtitle}">
                                                        <local:FZTextBlock HorizontalAlignment="Center" Style="{StaticResource A_Style_FZTextBlock_ContentHighlightSheet_Subtitle_Default}"
                                                                            local:ScreenReader.Line="{Binding (local:TextBlockInlineMarkup.Markup), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                                                                            local:ScreenReader.Event="OnLoad"
                                                                            local:ScreenReader.LineType="ScreenTitle" />
                                                    </Decorator>
                                                    <Decorator Style="{StaticResource A_Style_Decorator_ContentHighlight_Title}">
                                                        <local:FZTextBlock HorizontalAlignment="Center" Style="{StaticResource A_Style_FZTextBlock_ContentHighlightSheet_Title_Colored}"
                                                                           local:ScreenReader.Line="{Binding Text, RelativeSource={RelativeSource Self}}"
                                                                           local:ScreenReader.Event="OnLoad"
                                                                           local:ScreenReader.LineType="ScreenSubtitle" />
                                                    </Decorator>
                                                </StackPanel>
                                            </StackPanel>
                                            <Decorator Margin="0,38,0,36" VerticalAlignment="Top" DockPanel.Dock="Top">
                                                <local:FZTextBlock HorizontalAlignment="Center" VerticalAlignment="Top" TextWrapping="Wrap"
                                                            Style="{StaticResource A_Style_FZTextBlock_ContentHighlightSheet_Description}"
                                                            local:ScreenReader.Line="{Binding (local:TextBlockInlineMarkup.Markup), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                                                            local:ScreenReader.Event="OnLoad"
                                                            local:ScreenReader.LineType="ScreenDescription" />
                                            </Decorator>
                                        </StackPanel>
                                    </DockPanel>
                                </Grid>
                            </Grid>
                        </Decorator>
                    </StackPanel>
                </Grid>
            </Border>
        </Grid>
        <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
            <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
                <ContentControl x:Name="DefaultHelpPanel"
                                local:ControllerButtonPanel.BDescription="{local:Loc HelpButtons.IDS_Back}"
                        Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}"/>
            </ContentControl>
        </Decorator>
    </Grid>
</Page>
