<VideoOptions xmlns:local="clr-namespace:ForzaUI"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      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"
      x:Class="ForzaUI.A_VideoOptions"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      >

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

            <!-- SDR Brightness video options -->
            <System:Double x:Key="A_Double_SDRBrightness_Default">0.5</System:Double>
            <System:Double x:Key="A_Double_GammaAdjustStepSDR">0.05</System:Double>

            <!-- HDR WhitePoint Settings -->
            <System:Double x:Key="A_Double_HDRWhitePoint_Minimum">400</System:Double>
            <System:Double x:Key="A_Double_HDRWhitePoint_Maximum">10000</System:Double>
            <System:Double x:Key="A_Double_HDRWhitePoint_Default">1100</System:Double>
            <System:Double x:Key="A_Double_HDRWhitePoint_SmallChange">100</System:Double>
            <System:Double x:Key="A_Double_HDRWhitePoint_MaximumReciprocal">0.01</System:Double>
            <System:Double x:Key="A_Double_GammaAdjustStepHDR">10</System:Double>
            <local:NumUnitConverter x:Key="A_NumUnitConverter_HDRWhitePointPercent" FractionDigits="0" ShowUnit="False" Scale="{StaticResource A_Double_HDRWhitePoint_MaximumReciprocal}"/>


            <!-- HDR Exposure Settngs -->
            <System:Double x:Key="A_Double_HDRExposure_Minimum">50</System:Double>
            <System:Double x:Key="A_Double_HDRExposure_Maximum">500</System:Double>

            <!-- HDR Saturation Settngs -->
            <System:Double x:Key="A_Double_HDRSaturation_Minimum">0.35</System:Double>
            <System:Double x:Key="A_Double_HDRSaturation_Maximum">0.65</System:Double>
            <System:Double x:Key="A_Double_HDRSaturation_SmallChange">0.025</System:Double>
            <System:Double x:Key="A_Double_HDRSaturation_Default">0.5</System:Double>


            <!-- Colors -->

            <!-- Font Sizes -->


            <!-- Brightness Square -->

            <Storyboard x:Key="PART_A_Storyboard_FadeOut">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Fader">
                    <EasingDoubleKeyFrame KeyTime="0:0:0" Value="0" />
                    <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1" />
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>

            <ControlTemplate x:Key="A_ControlTemplate_DescriptionPanelContent" TargetType="ContentControl">
                <local:FZMaterial Style="{StaticResource H_Style_Container_GlassLowBlur_Description}"
                                  Margin="0">

                <Decorator Margin="24,24,24,24" MaxHeight="58" MinHeight="48" VerticalAlignment="Center">
                    <FZTextBlock Style="{StaticResource A_Style_FZTextBlock_DescriptionBlockBody}"
                        Text="{TemplateBinding Content}"
                        Color="{StaticResource A_Color_Body_Text}"
                        TextWrapping="Wrap"
                        VerticalAlignment="Center"
                        AutoScroll="{StaticResource H_AutoScrollSettings_Descriptions}"
                        AutoScroll.AllowScrolling="True"
                        />
                </Decorator> 
                </local:FZMaterial>
            </ControlTemplate>


            <local:TileMenuDataItem x:Key="A_DataItem_Accessibility" Heading="{local:Loc MyProfile.IDS_Accessibility}" Description="{local:Loc MyProfile.IDS_AccessibilityDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_ScreenReader" Heading="{local:Loc MyProfile.IDS_ScreenReaderPlatformOverride}" Description="{local:Loc MyProfile.IDS_ScreenReaderPlatformOverrideDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_AudioPlaybackSystem" Heading="{local:Loc MyProfile.IDS_PlaybackSystemInitialSetup}" Description="{local:Loc MyProfile.IDS_PlaybackSystemDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_Settings" Heading="{local:Loc MyProfile.IDS_SettingsOptions}" Description="{local:Loc MyProfile.IDS_SettingsOptionsDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_Accessibility" Heading="{local:Loc MyProfile.IDS_Accessibility}" Description="{local:Loc MyProfile.IDS_AccessibilityDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_Gamma" Heading="{local:Loc MyProfile.IDS_Brightness}" Description="{local:Loc MyProfile.IDS_BrightnessDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_Xbox60HzMode" Description="{local:Loc MyProfile.IDS_Xbox60HzModeDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_HDRWhitePoint" Heading="{local:Loc MyProfile.IDS_HDRWhitePoint}" Description="{local:Loc MyProfile.IDS_HDRWhitePointDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_HDRSaturation" Heading="{local:Loc MyProfile.IDS_HDRSaturation}" Description="{local:Loc MyProfile.IDS_HDRSaturationDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_HDRContentExposure" Heading="{local:Loc MyProfile.IDS_HDRPaperWhite}" Description="{local:Loc MyProfile.IDS_HDRPaperWhiteDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_HDRUIExposure" Heading="{local:Loc MyProfile.IDS_HDR_UIPaperWhite}" Description="{local:Loc MyProfile.IDS_HDR_UIPaperWhiteDescription}" />

            <local:TileMenuDataItem x:Key="A_DataItem_Accept" Heading="{local:Loc HelpButtons.IDS_Accept}" Description="{local:Loc MyProfile.IDS_AcceptOptionsDescription}" />
            <local:TileMenuDataItem x:Key="A_DataItem_StartGame" Heading="{local:Loc Main.IDS_To_Start}" Description="{local:Loc MyProfile.IDS_AcceptOptionsDescription}" />


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

            <MappingConverter
                x:Key="A_Converter_NotNull"
                Default="{StaticResource A_Boolean_True}">
                <MappingConverterEntry 
                    Key="{x:Null}"
                    Value="{StaticResource A_Boolean_False}" />
            </MappingConverter>

            <Style x:Key="A_Style_ListBoxItem_List_VideoOptions"
                TargetType="{x:Type ListBoxItem}"
                BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_NotFocusable}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=(ListBoxItem.Content).(local:BindingProxy.A), RelativeSource={RelativeSource Self}}" Value="True">
                        <Setter Property="Margin" Value="0"/>
                        <Setter Property="Height" Value="Auto"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                    <ContentPresenter x:Name="Presenter"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <ControlTemplate x:Key="A_ControlTemplate_Control_SelectableOption" TargetType="Control">
                <Grid Margin="18,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.55*"/>
                        <ColumnDefinition Width="0.45*"/>
                    </Grid.ColumnDefinitions>
                    <local:FZMaterial x:Name="MouseHitHelper"
                                      Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                                      Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                                      Color="#00000000"
                                      Margin="-20,0,0,0"
                                      Grid.ColumnSpan="2"
                                      Focusable="False"/>
                    <local:FZTextBlock  x:Name="ButtonText"
                                        Text="{Binding Tag.Heading, RelativeSource={RelativeSource TemplatedParent}}"
                                        Style="{StaticResource A_Style_FZTextBlock_SpinnerTitle}"
                                        HorizontalAlignment="Left" />
                    <local:FZTextBlock  x:Name="ButtonValue"
                                        Text="{Binding Path=(local:BindingProxy.A), Converter={StaticResource A_StringToUpper}, RelativeSource={RelativeSource TemplatedParent}}"
                                        Style="{StaticResource A_Style_FZTextBlock_SpinnerItem}"
                                        Grid.Column="1"
                                        HorizontalAlignment="Center" />
                </Grid>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding (Selector.IsSelected), RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                             Value="True">
                        <Setter TargetName="ButtonText"
                            Property="Color"
                            Value="#ffffffff" />
                        <Setter TargetName="ButtonValue"
                            Property="Color"
                            Value="#ffffffff" />
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <local:MappingConverter x:Key="A_MappingConverter_IsIEToTitle">
                <local:MappingConverterEntry Key="False" Value="{local:Loc ScreenTitles.IDS_VideoOptions}" />
                <local:MappingConverterEntry Key="True" Value="{local:Loc ScreenTitles.IDS_InitialGameOptions}" />
            </local:MappingConverter>

            <local:MappingConverter x:Key="A_MappingConverter_IsIEToButtonBarText">
                <local:MappingConverterEntry Key="False" Value="{local:Loc HelpButtons.IDS_Confirm}" />
                <local:MappingConverterEntry Key="True" Value="{local:Loc HelpButtons.IDS_Continue}" />
            </local:MappingConverter>


            <Style x:Key="A_Style_ControllerButtonControl_AButton" TargetType="local:ControllerButtonControl" BasedOn="{StaticResource A_Style_ControllerButtonControl_Default}">
                <Setter Property="Description" Value=""/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding (local:BindingProxy.B).(Name), RelativeSource={RelativeSource Self}}" Value="PART_AcceptButton">
                        <Setter Property="Description" Value="{Binding IsIE, Converter={StaticResource A_MappingConverter_IsIEToButtonBarText}}"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding (local:BindingProxy.B).(Name), RelativeSource={RelativeSource Self}}" Value="PART_StartGameButton">
                        <Setter Property="Description" Value="{local:Loc HelpButtons.IDS_Select}"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding (local:BindingProxy.B).(Name), RelativeSource={RelativeSource Self}}" Value="PART_SettingsButton">
                        <Setter Property="Description" Value="{local:Loc HelpButtons.IDS_Select}"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding (local:BindingProxy.B).(Name), RelativeSource={RelativeSource Self}}" Value="PART_AccessibilityButton">
                        <Setter Property="Description" Value="{local:Loc HelpButtons.IDS_Select}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>



            <Style x:Key="A_Style_SpinnerControl_Default_VideoOption"
                   BasedOn="{StaticResource A_Style_SpinnerControl_Default_InItemsList}"
                   TargetType="local:SpinnerControl">
                <Setter Property="local:AccumulateSelfOnParent.ParentName" 
                        Value="OptionsList"/>
                <Setter Property="local:AccumulateSelfOnParent.SortOrder"
                        Value="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"/>
                <Setter Property="local:FindSelfIndexInCollection.Collection"
                        Value="{Binding (local:AccumulateSelfOnParent.Output), ElementName=OptionsList}"/>
                <Setter Property="local:ScreenReader.SelectedNumber"
                        Value="{Binding (local:FindSelfIndexInCollection.Index), RelativeSource={RelativeSource Self}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"/>
                <Setter Property="local:ScreenReader.SelectedCount"
                        Value="{Binding (local:AccumulateSelfOnParent.Output).Count, ElementName=OptionsList, FallbackValue=0}"/>
            </Style>

            <Style x:Key="A_Style_Slider_Options_Default_VideoOption"
                   BasedOn="{StaticResource A_Style_Slider_Options_InItemsList}"
                   TargetType="SizedSlider">
                <Setter Property="SliderSize" 
                        Value="384"/>
                <Setter Property="local:AccumulateSelfOnParent.ParentName" 
                        Value="OptionsList"/>
                <Setter Property="local:AccumulateSelfOnParent.SortOrder"
                        Value="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"/>
                <Setter Property="local:FindSelfIndexInCollection.Collection"
                        Value="{Binding (local:AccumulateSelfOnParent.Output), ElementName=OptionsList}"/>
                <Setter Property="local:ScreenReader.SelectedNumber"
                        Value="{Binding (local:FindSelfIndexInCollection.Index), RelativeSource={RelativeSource Self}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"/>
                <Setter Property="local:ScreenReader.SelectedCount"
                        Value="{Binding (local:AccumulateSelfOnParent.Output).Count, ElementName=OptionsList, FallbackValue=0}"/>
                <Setter Property="Visibility" Value="{Binding HDRDataSource, Converter={StaticResource A_Converter_VisibleWhenNull}, FallbackValue={Static Visibility.Visible}}" />
            </Style>

            <Style x:Key="A_Style_Slider_Options_Default_VideoOption_SDR"  
                   TargetType="SizedSlider" 
                   BasedOn="{StaticResource A_Style_Slider_Options_Default_VideoOption}">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding SDRBrightnessDataSource, Converter={StaticResource A_Converter_NotNull}}" Value="True" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_Slider_Options_Default_VideoOption_HDR"  
                   TargetType="SizedSlider" 
                   BasedOn="{StaticResource A_Style_Slider_Options_Default_VideoOption}">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding HDRDataSource, Converter={StaticResource A_Converter_NotNull}}" Value="True" />
                            <Condition Binding="{Binding IsInitialBootFlow}" Value="False" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <MappingConverter x:Key="A_Converter_BindingSucceeds" Default="{StaticResource A_Boolean_True}"/>

            <Style x:Key="A_Style_Slider_Options_Default_VideoOption_HDRWhitePoint"
                   TargetType="SizedSlider" 
                   BasedOn="{StaticResource A_Style_Slider_Options_Default_VideoOption}">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding HDRDataSource.HDRWhitePoint, Converter={StaticResource A_Converter_BindingSucceeds}, FallbackValue={StaticResource A_Boolean_False}}" Value="{StaticResource A_Boolean_True}" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_Default_VideoOptions_Button" TargetType="local:FZButton" BasedOn="{StaticResource A_Style_Button_EmptyButton}">
                <Setter Property="Focusable" Value="True"/>
                <Setter Property="local:FocusOnMouseOverBehaviour.Self" Value="True"/>
                <Setter Property="MinHeight" Value="{StaticResource A_Double_TextMenu_Height_Default}"/>
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_Control_SelectableOption}"/>
                <Setter Property="local:AccumulateSelfOnParent.ParentName" 
                        Value="OptionsList"/>
                <Setter Property="local:AccumulateSelfOnParent.SortOrder"
                        Value="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"/>
                <Setter Property="local:FindSelfIndexInCollection.Collection"
                        Value="{Binding (local:AccumulateSelfOnParent.Output), ElementName=OptionsList}"/>
                <Setter Property="local:ScreenReader.SelectedNumber"
                        Value="{Binding (local:FindSelfIndexInCollection.Index), RelativeSource={RelativeSource Self}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"/>
                <Setter Property="local:ScreenReader.SelectedCount"
                        Value="{Binding (local:AccumulateSelfOnParent.Output).Count, ElementName=OptionsList, FallbackValue=0}"/>
                <Setter Property="local:ScreenReader.LineType" Value="SelectedItem" />
                <Setter Property="local:ScreenReader.Event" Value="OnFocus" />
                <Setter Property="local:ScreenReader.Line" Value="{Binding Tag.Heading, RelativeSource={RelativeSource Self}}" />
                <Setter Property="local:ScreenReader.ControlType" Value="Button" />
            </Style>

            <Style x:Key="A_Style_SpinnerControl_Xbox60HzMode"  
                   TargetType="local:SpinnerControl" 
                   BasedOn="{StaticResource A_Style_SpinnerControl_Default_VideoOption}">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding Console60HzDataSource, Converter={StaticResource A_Converter_NotNull}}" Value="True" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_SpinnerControl_ScreenReaderSetting"  
                   TargetType="local:SpinnerControl" 
                   BasedOn="{StaticResource A_Style_SpinnerControl_Default_VideoOption}">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ScreenReaderDataSource, Converter={StaticResource A_Converter_NotNull}}" Value="True" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_SpinnerControl_AudioPlaybackSystemSetting"  
                   TargetType="local:SpinnerControl" 
                   BasedOn="{StaticResource A_Style_SpinnerControl_Default_VideoOption}">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding AudioPlaybackSystemDataSource, Converter={StaticResource A_Converter_NotNull}}" Value="True" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_GlassPanel_Pill_VideoOptions_HDR" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource H_Style_Container_GlassLowBlur_Description}">
                <Setter Property="Visibility" Value="Hidden"/>
                <Setter Property="local:BindingProxy.B" Value=""/>
                <Style.Triggers>
                    <!-- We use proxy binding because we cannot look up the list element for usage in datatrigger-->
                    <DataTrigger Binding="{Binding Path=(local:BindingProxy.B).(Name), RelativeSource={RelativeSource Self}}" Value="PART_HDRControl">
                        <Setter Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_Slider_Options_Default_VideoOption_HDRWhitePoint"
                   TargetType="SizedSlider" 
                   BasedOn="{StaticResource A_Style_Slider_Options_Default_VideoOption}">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding HDRDataSource.HDRWhitePoint, Converter={StaticResource A_Converter_BindingSucceeds}, FallbackValue={StaticResource A_Boolean_False}}" Value="{StaticResource A_Boolean_True}" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FrameworkElement_TitleAndHDRContainer" TargetType="{x:Type FrameworkElement}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding HDRDataSource.HDRWhitePoint, Converter={StaticResource A_Converter_BindingSucceeds}, FallbackValue={StaticResource A_Boolean_False}}" Value="{StaticResource A_Boolean_True}">
                        <Setter Property="MinHeight" Value="286"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </ResourceDictionary>
    </Page.Resources>

    <Grid>
        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/HDRImages/CalibrationBG.png"
                          Visibility="{Binding IsInitialBootFlow, Converter={StaticResource A_Converter_BoolToVis_Inverted}, FallbackValue=Visible}">
            <local:FZMaterial.Preset>
                <local:FZMaterialPresetHDRCalibration/>
            </local:FZMaterial.Preset>
        </local:FZMaterial>
        <local:FZMaterialGlassCapture/>

        <local:PlayerBarControl x:Name="TopBar" Style="{StaticResource A_Style_PlayerBarControl}" />
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <local:ControllerButtonPanel x:Name="PART_HelpPanel" Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <local:ControllerButtonControl Button="A" Style="{StaticResource A_Style_ControllerButtonControl_AButton}" local:BindingProxy.B="{Binding SelectedItem, ElementName=OptionsList, FallbackValue={x:Null}}"/>
                <local:ControllerButtonControl Button="B" Description="{local:Loc HelpButtons.IDS_Back}" />
                <local:ControllerButtonControl Button="Y" Description="{local:Loc HelpButtons.IDS_ResetDefault}" Visibility="{Binding AnyOptions, Converter={StaticResource A_Converter_BoolToVis}}" />
            </local:ControllerButtonPanel>
        </ContentControl>

        <Border Style="{StaticResource A_Style_Border_ScenePadding}" SnapsToDevicePixels="True" UseLayoutRounding="True" >
            <Grid x:Name="PART_LayoutRoot" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Grid Style="{StaticResource A_Style_FrameworkElement_ScreenTilt}" Focusable="False" >
                    <StackPanel Name="BasicOptions" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}" Margin="0, 0, 0, 116">

                        <Decorator Style="{StaticResource A_Style_FrameworkElement_TitleAndHDRContainer}">
                            <StackPanel Orientation="Vertical" VerticalAlignment="Bottom">
                                <local:FZMaterial
                                        Style="{StaticResource A_Style_FZMaterial_GlassPanel_Pill_VideoOptions_HDR}"
                                        local:BindingProxy.A="True"
                                        local:BindingProxy.B="{Binding SelectedItem, ElementName=OptionsList, FallbackValue={x:Null}}">
                                    <StackPanel Orientation="Vertical">
                                        <Grid>
                                            <local:FZMaterial Margin="5"
                                                              Color="#FFFFFFFF">
                                                <local:FZMaterial.Preset>
                                                    <local:FZMaterialPresetHDR BrightnessScale="10000" Unlit="True"
                                                        CornerRadius="{StaticResource H_CornerRadius_All_1px}"/>
                                                </local:FZMaterial.Preset>
                                                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/HDR_Forza_Logo.png"
                                                                  Height="210"
                                                                  Width="330"
                                                                  HorizontalAlignment="Center"
                                                                  VerticalAlignment="Center"
                                                                  Color="#FFFFFFFF"
                                                                  Margin="0,10,0,0">
                                                    <local:FZMaterial.Preset>
                                                        <local:FZMaterialPresetHDR BrightnessScale="{Binding HDRDataSource.HDRLogoBrightness}" Unlit="True"/>
                                                    </local:FZMaterial.Preset>
                                                </local:FZMaterial>
                                            </local:FZMaterial>

                                            <!--We can not show text over the HDR Whitepoint display as the output is too intense for the alpha in the fonts to alias the text;
                                                to remedy this we place it on a isolated material not being manipulated by HDR Settings-->
                                            <local:FZMaterial Margin="16" 
                                                              HorizontalAlignment="Center" VerticalAlignment="Bottom"
                                                              Color="{StaticResource A_Color_White}" Style="{StaticResource A_Style_FZMaterial_FlatPanel_HeaderPill}">
                                                <local:FZTextBlock Text="{Binding Source={local:Loc MyProfile.IDS_VideoOption_HDR_Slider_Notification}}"
                                                                   CapHeight="15" 
                                                                   Color="{StaticResource H_Color_Primary_Black}" 
                                                                   FontFamily="Horizon_C" 
                                                                   HorizontalAlignment="Center" 
                                                                   VerticalAlignment="Center" 
                                                                   Margin="6" />
                                            </local:FZMaterial>
                                        </Grid>
                                    </StackPanel>
                                </local:FZMaterial>
                                <ContentControl Tag="{local:Loc ScreenTitles.IDS_MyProfile}" 
                                                Content="{Binding IsInitialBootFlow, Converter={StaticResource A_MappingConverter_IsIEToTitle}}" 
                                                Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                                local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/Options.png"
                                                Focusable="False" 
                                                HorizontalAlignment="Left" />
                            </StackPanel>
                        </Decorator>

                        <DockPanel HorizontalAlignment="Center">
                            <DockPanel Width="1000">
                                <ContentControl DockPanel.Dock="Bottom" Margin="0,0,0,4"
                                    Content="{Binding Tag.Description}"
                                    DataContext="{Binding SelectedItem, ElementName=OptionsList}"
                                    IsHitTestVisible="False"
                                    Template="{StaticResource A_ControlTemplate_DescriptionPanelContent}" />

                                <Grid Margin="0,0,0,4">
                                    <WrapListBox
                                        x:Name="OptionsList"
                                        ItemContainerStyle="{StaticResource A_Style_ListBoxItem_List_VideoOptions}"
                                        Template="{StaticResource A_ControlTemplate_ListBox_TextMenu_Default}"
                                        ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                        SelectedItem="{Binding SelectedItem}"
                                        AlternationCount="10000"
                                        local:AncestorPropertySetter.Property="SelectedItem"
                                        local:AncestorPropertySetter.Type="{x:Type local:VideoOptions}"
                                        local:AncestorPropertySetter.Value="{Binding SelectedItem, RelativeSource={RelativeSource Self}}">
                                        <SizedSlider Value="{Binding SDRBrightnessDataSource.Gamma}"
                                                Tag="{StaticResource A_DataItem_Gamma}" 
                                                Style="{StaticResource A_Style_Slider_Options_Default_VideoOption_SDR}" 
                                                SmallChange="{StaticResource A_Double_GammaAdjustStepSDR}"
                                                Default="{StaticResource A_Double_SDRBrightness_Default}"
                                                local:BindingProxy.B="{Binding Value, RelativeSource={RelativeSource Self}, Converter={local:NumUnitConverter Scale=100, FractionDigits=0}}"
                                                x:Name="PART_FirstItem" />

                                        <SizedSlider Value="{Binding HDRDataSource.HDRWhitePoint}"
                                                x:Name="PART_HDRControl"
                                                Tag="{StaticResource A_DataItem_HDRWhitePoint}"
                                                Style="{StaticResource A_Style_Slider_Options_Default_VideoOption_HDRWhitePoint}"
                                                Minimum="{StaticResource A_Double_HDRWhitePoint_Minimum}"
                                                Maximum="{StaticResource A_Double_HDRWhitePoint_Maximum}"
                                                SmallChange="{StaticResource A_Double_HDRWhitePoint_SmallChange}"
                                                Default="{StaticResource A_Double_HDRWhitePoint_Default}"
                                                local:BindingProxy.B="{Binding Value, RelativeSource={RelativeSource Self}, ConverterParameter=fracpercentage, Converter={StaticResource A_NumUnitConverter_HDRWhitePointPercent}}"
                                                local:BindingProxy.AlwaysValidNumeric="90" />

                                        <SizedSlider Value="{Binding HDRDataSource.HDRContentExposure}"
                                                Tag="{StaticResource A_DataItem_HDRContentExposure}"
                                                Style="{StaticResource A_Style_Slider_Options_Default_VideoOption_HDR}"
                                                SmallChange="{StaticResource A_Double_GammaAdjustStepHDR}"
                                                Minimum="{StaticResource A_Double_HDRExposure_Minimum}"
                                                Maximum="{StaticResource A_Double_HDRExposure_Maximum}"
                                                Default="{Binding HDRContentExposureDefault}"
                                                local:BindingProxy.B="{Binding Value, RelativeSource={RelativeSource Self}, Converter={local:NumUnitConverter FractionDigits=0}}"
                                                local:BindingProxy.AlwaysValidNumeric="90" />

                                        <SizedSlider Value="{Binding HDRDataSource.HDRUIExposure}"
                                                Tag="{StaticResource A_DataItem_HDRUIExposure}"
                                                Style="{StaticResource A_Style_Slider_Options_Default_VideoOption_HDR}"
                                                SmallChange="{StaticResource A_Double_GammaAdjustStepHDR}"
                                                Minimum="{StaticResource A_Double_HDRExposure_Minimum}"
                                                Maximum="{StaticResource A_Double_HDRExposure_Maximum}"
                                                Default="{Binding HDRUIExposureDefault}"
                                                local:BindingProxy.B="{Binding Value, RelativeSource={RelativeSource Self}, Converter={local:NumUnitConverter FractionDigits=0}}"
                                                local:BindingProxy.AlwaysValidNumeric="90" />

                                        <SizedSlider Value="{Binding HDRDataSource.HDRSaturation}"
                                                Tag="{StaticResource A_DataItem_HDRSaturation}"
                                                Style="{StaticResource A_Style_Slider_Options_Default_VideoOption_HDR}"
                                                SmallChange="{StaticResource A_Double_HDRSaturation_SmallChange}"
                                                Minimum="{StaticResource A_Double_HDRSaturation_Minimum}"
                                                Maximum="{StaticResource A_Double_HDRSaturation_Maximum}"
                                                Default="{StaticResource A_Double_HDRSaturation_Default}"
                                                local:BindingProxy.B="{Binding Value, RelativeSource={RelativeSource Self}, Converter={local:NumUnitConverter Scale=200, FractionDigits=0}}"
                                                local:BindingProxy.AlwaysValidNumeric="90" />

                                        <local:SpinnerControl Tag="{StaticResource A_DataItem_ScreenReader}"
                                                              Label="{Loc MyProfile.IDS_ScreenReaderPlatformOverride}"
                                                              SelectedIndex="{Binding ScreenReaderDataSource.ScreenReaderPlatformOverride}"
                                                              ItemsSource="{Binding ScreenReaderDataSource.ScreenReaderOptions}" 
                                                              Style="{StaticResource A_Style_SpinnerControl_ScreenReaderSetting}"/>

                                        <local:FZButton x:Name="PART_SettingsButton"
                                                        Tag="{StaticResource A_DataItem_Settings}"
                                                        Style="{StaticResource A_Style_Default_VideoOptions_Button}"
                                                        Command="{Binding SettingsCommand}"
                                                        Visibility="{Binding IsInitialBootFlow, Converter={StaticResource A_Converter_BoolToVis}, FallbackValue=Collapsed}"/>

                                        <local:FZButton x:Name="PART_AccessibilityButton"
                                                        Tag="{StaticResource A_DataItem_Accessibility}"
                                                        Style="{StaticResource A_Style_Default_VideoOptions_Button}"
                                                        Command="{Binding AccessibilityCommand}"
                                                        Visibility="{Binding IsInitialBootFlow, Converter={StaticResource A_Converter_BoolToVis}, FallbackValue=Collapsed}"/>

                                        <local:SpinnerControl Tag="{StaticResource A_DataItem_Xbox60HzMode}" 
                                                              Label="{local:Loc MyProfile.IDS_Xbox60HzMode}" 
                                                              SelectedIndex="{Binding Console60HzDataSource.Xbox60HzMode}" 
                                                              ItemsSource="{Binding Console60HzDataSource.Xbox60HzModeOptions}" 
                                                              Style="{StaticResource A_Style_SpinnerControl_Xbox60HzMode}"/>

                                        <local:SpinnerControl Tag="{StaticResource A_DataItem_AudioPlaybackSystem}"
                                                              Label="{Loc MyProfile.IDS_PlaybackSystemInitialSetup}"
                                                              SelectedIndex="{Binding AudioPlaybackSystemDataSource.PlaybackSystemIndex}"
                                                              ItemsSource="{Binding AudioPlaybackSystemDataSource.PlaybackSystemOptions}" 
                                                              Style="{StaticResource A_Style_SpinnerControl_AudioPlaybackSystemSetting}"/>

                                        <local:FZButton x:Name="PART_StartGameButton"
                                                        Tag="{StaticResource A_DataItem_StartGame}"
                                                        Style="{StaticResource A_Style_Default_VideoOptions_Button}"
                                                        Command="{Binding AcceptCommand}"
                                                        Visibility="{Binding IsInitialBootFlow, Converter={StaticResource A_Converter_BoolToVis}, FallbackValue=Collapsed}"/>

                                        <local:FZButton x:Name="PART_AcceptButton"
                                                        Tag="{StaticResource A_DataItem_Accept}"
                                                        Style="{StaticResource A_Style_Default_VideoOptions_Button}"
                                                        Command="{Binding AcceptCommand}"
                                                        Visibility="{Binding IsInitialBootFlow, Converter={StaticResource A_Converter_BoolToVis_Inverted}, FallbackValue=Collapsed}" />
                                    </WrapListBox>
                                </Grid>
                            </DockPanel>
                        </DockPanel>
                    </StackPanel>
                </Grid>
            </Grid>
        </Border>

        <local:FZMaterial x:Name="Fader" Color="Black" Opacity="0" IsHitTestVisible="False" />
    </Grid>
</VideoOptions>
