<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ForzaUI;assembly="
                    xmlns:System="clr-namespace:System;assembly=mscorlib">

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

    <ColorAlias x:Key="A_Color_ReadOnlySlider" Color="{StaticResource H_Color_Primary_Grey_70pc}"/>
    <ColorAlias x:Key="A_Color_ReadOnlySlider_RightTrack" Color="{StaticResource H_Color_Primary_Grey_70pc}"/>
    <ColorAlias x:Key="A_Color_ReadOnlySlider_Highlighted" Color="{StaticResource H_Color_Primary_Grey_70pc}"/>
    <ColorAlias x:Key="A_Color_ReadOnlySlider_RightTrack_Highlighted" Color="{StaticResource H_Color_Primary_Grey_70pc}"/>
    
    <System:Double x:Key="H_Slider_Track_Height">6</System:Double>

    <!-- Font Sizes -->
    <System:Double x:Key="A_FontSize_Cell">24</System:Double>

    <!--@@@@@@@@@@@@@@@@@@@-->
    <!-- DESCRIPTION PANEL -->
    <!--@@@@@@@@@@@@@@@@@@@-->

    <Style x:Key="A_Style_DescriptionPanelHeader" TargetType="ContentControl" BasedOn="{StaticResource A_Style_ContentControl_Header}">
    </Style>

    <Style x:Key="A_Style_FZTextBlock_DescriptionBlockBody" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_Body}" >
        <Setter Property="Color" Value="{StaticResource A_Color_Body_Text}" />
        <Setter Property="Stretch" Value="None" />
    </Style>

    <ControlTemplate x:Key="A_ControlTemplate_SidePanelContent" TargetType="ContentControl">
        <local:FZMaterial Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"
                          Margin="0,0,0,0" >
            <ContentPresenter/>
        </local:FZMaterial>
    </ControlTemplate>

    <QuarticEase x:Key="A_EasingFunction_AssistOptions_Infographic_Animation"
                         EasingMode="EaseOut" />

    <local:UIStoryboard x:Key="A_Storyboard_AssistOptions_BlendValueInputChanged">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="{x:Null}"
                                               FillBehavior="Stop"
                                               Storyboard.TargetProperty="(local:BlendValue.Blend)">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                            Value="0" />
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                            Value="0" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.5"
                                          Value="1"
                                          EasingFunction="{StaticResource A_EasingFunction_AssistOptions_Infographic_Animation}">
            </EasingDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>
    </local:UIStoryboard>

    <local:NumUnitConverter x:Key="A_Assist_NumUnitConverter_TotalRaceBonus" FractionDigits="0" ShowUnit="True" PositiveSign="True"/>

    <DataTemplate DataType="{x:Type local:OptionsMenuAssistDetails}">
        <StackPanel>
            <Grid x:Name="DifficultyPanel"
              DockPanel.Dock="Bottom"
              HorizontalAlignment="Center"
              Margin="0,-30,0,-4">
                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/UI_Symbols/CR_Difficulty_Infographic_BG.png"
                              Width="121"
                              Height="121" />
                <Grid Height="196" Width="196">
                    <local:FZMaterial x:Name="InitialRing"
                                      Color="{StaticResource A_Color_Options_DifficultyBonus}"
                                      Tag="{Binding TotalBonus, NotifyOnTargetUpdated=True}"
                                      local:BlendValue.InputChangedStoryboard="{StaticResource A_Storyboard_AssistOptions_BlendValueInputChanged}"
                                      local:BlendValue.Input="{Binding TotalBonus}"
                                      local:BlendValue.BlendFromPreviousOutput="True"
                                      local:BlendValue.ShouldSkipInitialInputChange="True">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRadialBar x:Name="Preset"
                                                             TargetRatio="1.0"
                                                             ShadowIntensity="0"
                                                             TipGlowFade="0.0"
                                                             AngleAmount="0"
                                                             BarWidth="0.17"
                                                             BackgroundColor="#00FFFFFF"
                                                             Ratio="{Binding Path=(local:BlendValue.Output), RelativeSource={RelativeSource FindAncestor, AncestorType=local:FZMaterial}}">
                            </local:FZMaterialPresetRadialBar>
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                </Grid>
                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/UI_Symbols/CR_Difficulty_Infographic_CR_Icon.png"
                                  Width="121"
                                  Height="121" />
            </Grid>
            <local:FZTextBlock FontFamily="Horizon_A_tf"
                               CapHeight="44"
                               Color="{StaticResource H_Color_Primary_Yellow}"
                               HorizontalAlignment="Center"
                               local:BlendValue.InputChangedStoryboard="{StaticResource A_Storyboard_AssistOptions_BlendValueInputChanged}"
                               local:BlendValue.Input="{Binding TotalBonus}"
                               local:BlendValue.BlendFromPreviousOutput="True"
                               local:BlendValue.ShouldSkipInitialInputChange="True"
                               Text="{Binding Path=(local:BlendValue.Output), ConverterParameter=fracpercentage, Converter={StaticResource A_Assist_NumUnitConverter_TotalRaceBonus}, RelativeSource={RelativeSource Self}}" />
            <Decorator Height="21" />
            <local:FZTextBlock Text="{local:Loc Assists.IDS_Title_Total_Race_Bonus}"
                               HorizontalAlignment="Center"
                               CapHeight="18"
                               FontFamily="Horizon_A"
                               Color="{StaticResource H_Color_Primary_White}" />
            <Decorator Height="40" />
        </StackPanel>
    </DataTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_SidePanel" TargetType="ContentControl">
        <DockPanel>
            <ContentControl DockPanel.Dock="Top" Content="{TemplateBinding Tag}" Style="{StaticResource A_Style_DescriptionPanelHeader}" />
            <ContentControl DockPanel.Dock="Top" Content="{TemplateBinding Content}" Template="{DynamicResource A_ControlTemplate_SidePanelContent}" />
        </DockPanel>
    </ControlTemplate>

    <Style x:Key="A_Style_FZTextBlock_AutoScroll_OptionsDescription" BasedOn="{StaticResource A_Style_FZTextBlock_DescriptionBlockBody}" TargetType="local:FZTextBlock">
        <Style.Resources>
            <Style x:Key="A_Style_FZRun_Description_Markup_BOLD" TargetType="local:FZRun">
                <Setter Property="FontFamily" Value="Horizon_C"/>
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Yellow}" />
            </Style>
            <Style x:Key="A_Style_FZRun_Description_Markup_SUPERSCRIPT" TargetType="local:FZRun">
                <Setter Property="SubscriptScale" Value="-0.75" />
            </Style>
            <MappingConverter x:Key="A_MappingConverter_Description" >
                <MappingConverterEntry Key="{NoCase BOLD}" Value="{StaticResource A_Style_FZRun_Description_Markup_BOLD}" />
                <MappingConverterEntry Key="{NoCase SUPERSCRIPT}" Value="{StaticResource A_Style_FZRun_Description_Markup_SUPERSCRIPT}" />
            </MappingConverter>
        </Style.Resources>

        <Setter Property="Color" Value="{StaticResource A_Color_Body_Text}" />
        <Setter Property="MarkupConverter" Value="{StaticResource A_MappingConverter_Description}" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="AutoScroll" Value="{StaticResource H_AutoScrollSettings_Descriptions}" />
        <Setter Property="AutoScroll.AllowScrolling" Value="True" />    
    </Style>

    <ControlTemplate x:Key="A_ControlTemplate_ContentControl_DescriptionPanel_DescriptionText"
                     TargetType="ContentControl">
        <Decorator Margin="24">
            <FZTextBlock Style="{DynamicResource A_Style_FZTextBlock_AutoScroll_OptionsDescription}"
                Text="{TemplateBinding Content}"
                Margin="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_LangStrToAutoScrollMargin}}"
                local:ScreenReader.Line="{Binding Content, Converter={StaticResource A_Converter_TrimInlineMarkup}, RelativeSource={RelativeSource TemplatedParent}}"
                local:ScreenReader.LineType="ItemDescription"
                local:ScreenReader.Event="OnChange"
                />
        </Decorator>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_DescriptionPanel"
                     TargetType="ContentControl">
        <ContentControl Template="{StaticResource A_ControlTemplate_SidePanel}"
                        Tag="{local:Loc Assists.IDS_Title_Description}">
            <ContentControl Template="{StaticResource A_ControlTemplate_ContentControl_DescriptionPanel_DescriptionText}"
                            Content="{TemplateBinding Content}" IsHitTestVisible="False" Focusable="False"/>
        </ContentControl>
    </ControlTemplate>

    <DataTemplate DataType="{x:Type local:OptionsMenuItemDescription}">
        <Decorator Margin="24">
            <Decorator Width="10" Height="10"/>
            <FZTextBlock Style="{StaticResource A_Style_FZTextBlock_AutoScroll_OptionsDescription}"
                Text="{Binding TextDescription}"
                Margin="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_LangStrToAutoScrollMargin}}"
                local:ScreenReader.Line="{Binding TextDescription, Converter={StaticResource A_Converter_TrimInlineMarkup}}"
                local:ScreenReader.LineType="ItemDescription"
                local:ScreenReader.Event="OnChange"
                />
        </Decorator>
    </DataTemplate>

    <Double x:Key="A_Opacity_Divider_Active">0.06</Double>
    <Double x:Key="A_Opacity_Divider_NonActive">0.1</Double>

    <Style x:Key="H_Style_Text_ListOptionTextValue"
           TargetType="FZTextBlock"
           BasedOn="{StaticResource H_Style_Text_ListOption_16px}">
        <Setter Property="Text" Value="{Binding Value}"/>
        <Setter Property="MarkupConverter" Value="{StaticResource A_MappingConverter_TextMenu}"/>
        <Setter Property="TextAlignment" Value="Left"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="ScreenReader.Event" Value="OnChange"/>
        <Setter Property="ScreenReader.ControlType" Value="Button"/>
        <Setter Property="ScreenReader.LineType" Value="SelectedValue"/>
        <Setter Property="FontFamily" Value="Horizon_B" />
        <Setter Property="Color" Value="{StaticResource A_Color_OptionsItem_EnabledNotFocused}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsKeyboardFocusWithin, ElementName=Background}"
                         Value="True">
                <Setter Property="ScreenReader.Line"
                        Value="{Binding Value, Converter={TrimInlineMarkupConverter}}" />
                <Setter Property="Color"
                        Value="{StaticResource A_Color_OptionsItem_Focused}" />
            </DataTrigger>
            <DataTrigger Binding="{Binding Source={StaticResource H_UseBoldFontsForHigherContrast}}" Value="True">
                <Setter Property="FontFamily"
                        Value="Horizon_A" />
            </DataTrigger>
            <!-- disabled (list does not have focus) -->
            <DataTrigger Binding="{Binding IsEnabled, ElementName=Background}"
                         Value="False">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                <Setter Property="Opacity"
                        Value="{StaticResource A_Double_OptionsItemOpacity_Disabled}" />
            </DataTrigger>
            <!-- enabled but inactive (list has focus, but item is not currently editable) -->
            <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="Inactive">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                <Setter Property="Opacity"
                        Value="{StaticResource A_Double_OptionsItemOpacity_Disabled}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="H_Style_Text_ListOptionLabel"
           TargetType="FZTextBlock"
           BasedOn="{StaticResource H_Style_Text_ListOptionTextValue}">
        <Setter Property="Text" Value="{Binding Title}"/>
        <Setter Property="ScreenReader.LineType" Value="SelectedItem"/>
        <Setter Property="ScreenReader.SelectedNumber" Value="{Binding (VirtualizingWrapPanel.ItemIndex), FallbackValue=0, RelativeSource={RelativeSource AncestorType={Type ListBoxItem}}, Converter={StaticResource A_IndexToNumberConverter}}"/>
        <Setter Property="ScreenReader.SelectedCount" Value="{Binding Items.Count, FallbackValue=0, RelativeSource={RelativeSource AncestorType={Type Selector}}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                         Value="True">
                <Setter Property="ScreenReader.Line"
                        Value="{Binding Title, Converter={TrimInlineMarkupConverter}}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="H_Style_Divider_ListOption_Alternative" 
           TargetType="FZMaterial"
           BasedOn="{StaticResource H_Style_Divider_ListOption}" >
        <Setter Property="Height" Value="2" />
        <Setter Property="Opacity" Value="{StaticResource A_Opacity_Divider_Active}" />
        <Setter Property="Color" Value="{StaticResource A_Color_OptionsItem_EnabledNotFocused}" />
        <Setter Property="Margin" Value="8,0" />
        <Style.Triggers>
            <!-- disabled (list does not have focus) -->
            <DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="False">
                <Setter Property="Opacity" Value="{StaticResource A_Opacity_Divider_NonActive}" />
                <Setter Property="Color" Value="{StaticResource A_Color_OptionsItem_Disabled}" />
            </DataTrigger>
            <!-- enabled but inactive (list has focus, but item is not currently editable) -->
            <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="Inactive">
                <Setter Property="Opacity" Value="{StaticResource A_Opacity_Divider_NonActive}" />
                <Setter Property="Color" Value="{StaticResource A_Color_OptionsItem_Disabled}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <AutoScrollSettings x:Key="H_AutoScrollSettings_ListOptionLabel"
        Speed="30"
        ScrollOrientation="Horizontal"
        InitialPause="0:0:01.0"/>
    <Style x:Key="H_Style_Text_ListOptionLabelForAutoScroll"
           TargetType="FZTextBlock"
           BasedOn="{StaticResource H_Style_Text_ListOptionLabel}">
        <Setter Property="ScreenReader.SelectedNumber" Value="{Binding (VirtualizingWrapPanel.ItemIndex), FallbackValue=0, RelativeSource={RelativeSource AncestorType={Type ListBoxItem}, AncestorLevel=2}, Converter={StaticResource A_IndexToNumberConverter}}"/>
        <Setter Property="ScreenReader.SelectedCount" Value="{Binding Items.Count, FallbackValue=0, RelativeSource={RelativeSource AncestorType={Type Selector}, AncestorLevel=2}}"/>
        <Setter Property="TextTrimming" Value="CharacterEllipsis" />
        <Setter Property="UseLayoutRounding" Value="False"/>
        <Setter Property="ClipToBounds" Value="False" />
        <Setter Property="Stretch" Value="None" />
        <Setter Property="AutoScroll" Value="{StaticResource H_AutoScrollSettings_ListOptionLabel}" />
        <Setter Property="AutoScroll.AllowScrolling" Value="False" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem, AncestorLevel=2}}" Value="True">
                <Setter Property="ScreenReader.Line"
                        Value="{Binding Converter={TrimInlineMarkupConverter}}" />
                <Setter Property="Color"
                        Value="{StaticResource A_Color_OptionsItem_Focused}" />
            </DataTrigger>
            <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
                <Setter Property="TextTrimming" Value="None" />
                <Setter Property="AutoScroll.AllowScrolling" Value="True" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
    
    <Style x:Key="H_Style_FZMaterial_ListOptionIndentIcon"
           TargetType="FZMaterial">
        <Setter Property="Width" Value="15" />
        <Setter Property="Height" Value="15" />
        <Setter Property="Margin" Value="18,-3,-10,0" />
        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Data_Bound/UI_Symbols/Settings_Child_Icon.png" />
        <Setter Property="Color" Value="{StaticResource A_Color_OptionsItem_EnabledNotFocused}" />
        <Setter Property="Visibility" Value="{Binding IsIndented, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" 
                         Value="True">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_OptionsItem_Focused}" />
                <Setter Property="Opacity" 
                        Value="1" />
            </DataTrigger>
            <!-- disabled (list does not have focus) -->
            <DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" 
                         Value="False">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_OptionsItem_Disabled}" />
            </DataTrigger>
            <!-- enabled but inactive (list has focus, but item is not currently editable) -->
            <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="Inactive">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_OptionsItem_Disabled}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>    

    <DataTemplate DataType="{Type OptionsMenuSpinnerOption}">
        <DockPanel>
            <FZMaterial Style="{StaticResource H_Style_FZMaterial_ListOptionIndentIcon}" DockPanel.Dock="Left" />
            <DockPanel>
                <SpinnerControl 
                                DockPanel.Dock="Right"
                                ItemsSource="{Binding Items}"
                                SelectedIndex="{Binding ValueIndex, Mode=TwoWay}"
                                Margin="0,0,10,0">
                    <SpinnerControl.Style>
                        <Style TargetType="SpinnerControl" BasedOn="{StaticResource A_Style_SpinnerControl_Default}">
                            <Style.Triggers>
                                <!-- actually need to disable the spinner itself when the item is Inactive, so that it cannot be edited while focused -->
                                <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="Inactive">
                                    <Setter Property="IsEnabled" Value="False" />
                                </DataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding IsKeyboardFocused, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=False}"
                                                   Value="True"/>
                                        <Condition Binding="{Binding IsEnabled}" 
                                                   Value="True"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="FocusSelf.WhenTrue" Value="True"/>
                                </MultiDataTrigger>
                            </Style.Triggers>
                        </Style>
                    </SpinnerControl.Style>
                    <SpinnerControl.Resources>
                        <GridLength x:Key="A_GridLength_SpinnerWidth">440</GridLength>
                    </SpinnerControl.Resources>
                </SpinnerControl>
                <Decorator HorizontalAlignment="Left">
                    <FZTextBlock 
                        Text="{Binding Title}"
                        Style="{StaticResource H_Style_Text_ListOptionLabelForAutoScroll}"
                        FontFamily="Horizon_B"
                        ScreenReader.ControlType="Spinner"
                        MarkupConverter="{StaticResource A_MappingConverter_TextMenu}"/>
                </Decorator>   
            </DockPanel>
        </DockPanel>
    </DataTemplate>

    <DataTemplate DataType="{Type OptionsMenuSliderOption}">
        <DockPanel>
            <FZMaterial Style="{StaticResource H_Style_FZMaterial_ListOptionIndentIcon}" DockPanel.Dock="Left" />  
            <SizedSlider DockPanel.Dock="Right" 
                     FocusSelf.WhenTrue="{Binding IsKeyboardFocused, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=False}"
                    Minimum="{Binding Min}"
                    Maximum="{Binding Max}"
                    SmallChange="{Binding Step}"
                    LargeChange="{Binding Step, Converter={LinearTransformConverter Scale=2}}"
                    TickFrequency="{Binding Step}"
                    IsSnapToTickEnabled="True"
                    Value="{Binding Value, Mode=TwoWay}">
                <SizedSlider.Style>
                    <Style TargetType="SizedSlider" BasedOn="{StaticResource A_Style_Slider_Options_Internal}">
                        <Setter Property="BindingProxy.B"
                                Value="{Binding Value, RelativeSource={RelativeSource Self}, Converter={NumUnitConverter FractionDigits=0}}"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding SliderAudioEvent, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Visible}">
                                <Setter Property="SliderAudioEventName" Value="{Binding SliderAudioEvent}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Decimals}"
                                         Value="1">
                                <Setter Property="BindingProxy.B"
                                        Value="{Binding Value, RelativeSource={RelativeSource Self}, Converter={NumUnitConverter FractionDigits=1}}"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Decimals}"
                                         Value="2">
                                <Setter Property="BindingProxy.B"
                                        Value="{Binding Value, RelativeSource={RelativeSource Self}, Converter={NumUnitConverter FractionDigits=2}}"/>
                            </DataTrigger>
                            <!-- actually need to disable the slider itself when the item is Inactive, so that it cannot be edited while focused -->
                            <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="Inactive">
                                <Setter Property="IsEnabled" Value="False" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </SizedSlider.Style>
            </SizedSlider>  
            <Decorator>
                <FZTextBlock 
                    Text="{Binding Title}"
                    Style="{StaticResource H_Style_Text_ListOptionLabelForAutoScroll}"
                    ScreenReader.ControlType="Slider"/>
            </Decorator>
        </DockPanel>
    </DataTemplate>

    <DataTemplate DataType="{Type OptionsMenuButtonOption}">
        <Grid IsHitTestVisible="False">
            <Decorator MaxWidth="370" HorizontalAlignment="Left">
                <FZTextBlock 
                    Text="{Binding Title}"
                    Style="{StaticResource H_Style_Text_ListOptionLabelForAutoScroll}"
                    ScreenReader.ControlType="Button"/>
            </Decorator>
        </Grid>
    </DataTemplate>

    <DataTemplate DataType="{Type OptionsMenuHeaderOption}">
        <Grid>
            <FZMaterial x:Name="HeaderBackground"
                Color="{StaticResource H_Color_Primary_Green}"
                Preset="{Roundtangle CornerRadius=2}" />
            <local:FZTextBlock x:Name="HeaderText"
                Text="{Binding Title}"
                Color="{StaticResource H_Color_Primary_Black}"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                FontFamily="Horizon_A"
                CapHeight="19"
                Margin="16,0"/>
        </Grid>
        <DataTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="HeaderBackground" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="HeaderText" Property="Color" Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                <Setter TargetName="HeaderText" Property="Opacity" Value="{StaticResource A_Double_OptionsItemOpacity_Disabled}" />
            </Trigger>
        </DataTemplate.Triggers>
    </DataTemplate>

    <DataTemplate DataType="{Type OptionsMenuTextEntryOption}">
        <Grid>
            <Decorator MaxWidth="370" HorizontalAlignment="Left">
                <FZTextBlock 
                    Text="{Binding Title}"
                    Style="{StaticResource H_Style_Text_ListOptionLabelForAutoScroll}"
                    ScreenReader.ControlType="Button" />
            </Decorator>
            <FZTextBlock x:Name="Label"
                         HorizontalAlignment="Right"
                         TextAlignment="Center"
                         Width="300"
                         TextTrimming="CharacterEllipsis"
                         Style="{StaticResource H_Style_Text_ListOptionTextValue}" />
        </Grid>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Value}" Value="">
                <Setter TargetName="Label"
                            Property="Text"
                            Value="{Binding EmptyValue}"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

    <Style x:Key="A_Style_DescriptionPanel" TargetType="ContentControl">
        <Setter Property="Width" Value="354" />
        <Setter Property="Height" Value="686" />
        <Setter Property="Margin" Value="6,-0.5,0,0" />
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_DescriptionPanel}"/>
    </Style>

    <Style x:Key="A_Style_DescriptionPanel_Options" BasedOn="{StaticResource A_Style_DescriptionPanel}" TargetType="ContentControl">
        <Setter Property="Height" Value="661" />
    </Style>

    <!--@@@@@@@@-->
    <!-- SLIDER -->
    <!--@@@@@@@@-->

    <!-- Focused Bar -->
    <Style x:Key="A_Style_RepeatButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <local:FZMaterial x:Name="Background"  Color="{StaticResource A_Color_Slider_Foreground_Deselected}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_RepeatButton_Left"
           TargetType="{x:Type RepeatButton}"
           BasedOn="{StaticResource A_Style_RepeatButton}">
        <Setter Property="Margin"
                Value="0,0,0,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid>
                        <local:FZMaterial x:Name="MouseHitTestHelper" Opacity="0" />
                        <local:FZMaterial x:Name="Background"
                                          Color="{StaticResource H_Color_Primary_Pink}"
                                          Height="{DynamicResource H_Slider_Track_Height}"
                                          Preset="{Roundtangle CornerRadius={CornerRadius TopRight=3, BottomRight=3}}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Slider}, Path=Tag, FallbackValue=False}" Value="True">
                            <Setter TargetName="Background" Property="Opacity" Value="1" />
                            <Setter TargetName="Background" Property="Color" Value="{StaticResource A_Color_ReadOnlySlider_RightTrack}" />
                        </DataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Slider}, Path=Tag, FallbackValue=False}" Value="True"/>
                                <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=IsKeyboardFocusWithin}" Value="True"/>
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="Background" Property="Color" Value="{StaticResource A_Color_ReadOnlySlider_RightTrack_Highlighted}"/>
                        </MultiDataTrigger>
                        <!-- disabled (list does not have focus) -->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=IsEnabled}" Value="False">
                            <Setter TargetName="Background" Property="Color" Value="{StaticResource H_Color_Primary_Grey_70pc}" />
                        </DataTrigger>
                        <!-- enabled but inactive (list has focus, but item is not currently editable) -->
                        <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}}" Value="Inactive">
                            <Setter TargetName="Background" Property="Color" Value="{StaticResource H_Color_Primary_Grey_70pc}" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_RepeatButton_Right"
           TargetType="{x:Type RepeatButton}"
           BasedOn="{StaticResource A_Style_RepeatButton}">
        <Setter Property="Margin"
                Value="0,0,0,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid>
                        <local:FZMaterial x:Name="MouseHitTestHelper" Opacity="0" />
                        <local:FZMaterial x:Name="Background"
                                          Color="{StaticResource H_Color_Primary_Pink}"
                                          Height="{DynamicResource H_Slider_Track_Height}"
                                          VerticalAlignment="Center"
                                          Preset="{Roundtangle CornerRadius={CornerRadius TopLeft=3, BottomLeft=3}}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Slider}, Path=Tag, FallbackValue=False}" Value="True">
                            <Setter TargetName="Background" Property="Opacity" Value="1" />
                            <Setter TargetName="Background" Property="Color" Value="{StaticResource A_Color_ReadOnlySlider_RightTrack}" />
                        </DataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Slider}, Path=Tag, FallbackValue=False}" Value="True"/>
                                <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=IsKeyboardFocusWithin}" Value="True"/>
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="Background" Property="Color" Value="{StaticResource A_Color_ReadOnlySlider_RightTrack_Highlighted}"/>
                        </MultiDataTrigger>
                        <!-- disabled (list does not have focus) -->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=IsEnabled}" Value="False">
                            <Setter TargetName="Background" Property="Color" Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                        </DataTrigger>
                        <!-- enabled but inactive (list has focus, but item is not currently editable) -->
                        <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}}" Value="Inactive">
                            <Setter TargetName="Background" Property="Color" Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <System:Double x:Key="A_Double_Thumb_Size">18</System:Double>
    <Thickness x:Key="A_Thickness_Track_ThumbSpace_LeftSide">0,0,0,0</Thickness>
    <Thickness x:Key="A_Thickness_Track_ThumbSpace_RightSide">0,0,0,0</Thickness>
    <Thickness x:Key="A_Thickness_Track_ThumbSpace">-9,0,-9,0</Thickness>

    <Style x:Key="A_Style_Thumb_OptionsSlider" TargetType="{x:Type Thumb}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Grid Width="0" Height="0" UseLayoutRounding="False" SnapsToDevicePixels="False">
                        <local:FZMaterial x:Name="shadow" Color="#000"
                            Margin="-12"
                            Preset="{Roundtangle CornerRadius=12, Softness=12}"/>
                        <Grid x:Name="thumb"
                            Width="{StaticResource A_Double_Thumb_Size}"
                            Height="{StaticResource A_Double_Thumb_Size}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center">
                            <local:FZMaterial x:Name="hover" 
                                Color="{StaticResource H_Color_Primary_White}"
                                Margin="-3"
                                Visibility="Hidden"
                                Preset="{Roundtangle CornerRadius=10.5}"/>
                            <local:FZMaterial x:Name="OuterMaterial" 
                                Color="{StaticResource H_Color_Primary_Pink}"
                                Preset="{Roundtangle CornerRadius=9}"/>
                            <local:FZMaterial x:Name="CenterMaterial"
                                Color="{StaticResource H_Color_Primary_White}"
                                Margin="4.5"
                                Preset="{Roundtangle CornerRadius=4.5}"/>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!-- disabled (list does not have focus) -->
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=IsEnabled}"
                                 Value="False">
                            <Setter TargetName="OuterMaterial"
                                    Property="Color"
                                    Value="{StaticResource H_Color_Primary_Grey_70pc}" />
                            <Setter TargetName="CenterMaterial"
                                    Property="Color"
                                    Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                        </DataTrigger>
                        <!-- enabled but inactive (list has focus, but item is not currently editable) -->
                        <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}}" Value="Inactive">
                            <Setter TargetName="OuterMaterial"
                                    Property="Color"
                                    Value="{StaticResource H_Color_Primary_Grey_70pc}" />
                            <Setter TargetName="CenterMaterial"
                                    Property="Color"
                                    Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsMouseOver, ElementName=thumb}"
                                     Value="True">
                            <Setter TargetName="hover"
                                    Property="Visibility"
                                    Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsMouseCaptureWithin, RelativeSource={RelativeSource TemplatedParent}}"
                                     Value="True">
                            <Setter TargetName="hover"
                                    Property="Visibility"
                                    Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Slider}, Path=Tag, FallbackValue=False}" Value="True">
                            <Setter TargetName="OuterMaterial"
                                    Property="Color"
                                    Value="{StaticResource A_Color_ReadOnlySlider}" />
                            <Setter TargetName="CenterMaterial"
                                    Property="Color"
                                    Value="{StaticResource H_Color_Primary_White}" />
                            <Setter TargetName="shadow"
                                    Property="Visibility"
                                    Value="Hidden" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_InputControlText" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonF}" TargetType="local:FZTextBlock">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="StretchDirection" Value="DownOnly" />
        <Setter Property="CapHeight" Value="19" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding Source={StaticResource H_UseBoldFontsForHigherContrast}}" Value="True">
                <Setter
                    Property="FontFamily"
                    Value="Horizon_A" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_SliderControlText" BasedOn="{StaticResource A_Style_FZTextBlock_InputControlText}" TargetType="local:FZTextBlock">
        <Setter Property="Color"
                Value="{StaticResource H_Color_Primary_Black}" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="IsHitTestVisible" Value="False"/>
    </Style>

    <Style x:Key="A_Style_SliderControlText_Value" BasedOn="{StaticResource A_Style_SliderControlText}" TargetType="local:FZTextBlock">
        <Setter Property="FontFamily" Value="Horizon_B_tf" />
        <Setter Property="HorizontalAlignment"
                Value="Right" />
        <Setter Property="TextAlignment"
                Value="Right" />
        <Setter Property="DockPanel.Dock"
                Value="Right" />
    </Style>

    <Style x:Key="A_Style_Track_OptionsSlider"
           TargetType="FrameworkElement">
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="Height"
                Value="{Binding Height, RelativeSource={RelativeSource AncestorType=Slider}}" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_SpinnerTitle" BasedOn="{StaticResource A_Style_FZTextBlock_InputControlText}" TargetType="local:FZTextBlock">
        <Setter Property="Color"
                Value="{StaticResource A_Color_TextMenu_Text_Default}" />
        <Setter Property="Margin" Value="6,1,0,0" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TitleInListboxItem"
           BasedOn="{StaticResource A_Style_FZTextBlock_SpinnerTitle}"
           TargetType="local:FZTextBlock">
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                         Value="True">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_TextMenu_Text_Highlighted}"/>
            </DataTrigger>
            <!-- disabled (list does not have focus) -->
            <DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource AncestorType=ListBoxItem}, FallbackValue=True}"
                         Value="False">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_TextMenu_Text_Locked}"/>
            </DataTrigger>
            <!-- enabled but inactive (list has focus, but item is not currently editable) -->
            <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="Inactive">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_TextMenu_Text_Locked}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>


    <Style x:Key="A_Style_Thumb_OptionsSlider_DefaultPositionIndicator"
                   TargetType="{x:Type Thumb}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Decorator HorizontalAlignment="Center"
                               Width="0"
                               Margin="{StaticResource A_Thickness_Track_ThumbSpace}"
                               VerticalAlignment="Bottom">
                        <!-- setting the opacity to A_Double_OptionsItemOpacity_Disabled by default because on the concept even when the list of options is enabled this element's opacity is not 1 -->
                        <local:FZMaterial 
                                      Width="10"
                                      Height="7"
                                      RenderTransformOrigin="0.5,0.5"
                                      HorizontalAlignment="Center"
                                      x:Name="Centre"
                                      Color="{StaticResource H_Color_Primary_Grey_70pc}"
                                      ImageSource="/ForzaUI;component/Textures/Anthem/A_Slider_Center.png" />
                    </Decorator>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=IsEnabled}"
                                             Value="False">
                            <Setter TargetName="Centre"
                                            Property="Color"
                                            Value="{StaticResource H_Color_Primary_Grey_70pc}" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_Slider_Label" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_SliderControlText}">
        <Setter Property="Text" Value="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"/>
        <Setter Property="local:ScreenReader.Event" Value="OnChange"/>
        <Setter Property="local:ScreenReader.ControlType" Value="Slider"/>
        <Setter Property="local:ScreenReader.LineType" Value="SelectedItem"/>
        <Setter Property="local:ScreenReader.SelectedNumber" Value="{Binding (local:ScreenReader.SelectedNumber), RelativeSource={RelativeSource AncestorType={x:Type Slider}}}"/>
        <Setter Property="local:ScreenReader.SelectedCount" Value="{Binding (local:ScreenReader.SelectedCount), RelativeSource={RelativeSource AncestorType={x:Type Slider}}}"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_SizedSlider_Label" TargetType="{x:Type FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_Slider_Label}"/>

    <Style x:Key="A_Style_FZTextBlock_Slider_Value" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_SliderControlText_Value}">
        <Setter Property="Text" Value="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}"/>
        <Setter Property="Margin" Value="4,0,10,0"/>
        <Setter Property="MaxWidth" Value="68"/>
        <Setter Property="local:ScreenReader.Event" Value="OnChange"/>
        <Setter Property="local:ScreenReader.LineType" Value="SelectedValue"/>
        <Setter Property="CapHeight" Value="19"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_SizedSlider_Value" TargetType="{x:Type FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_Slider_Value}"/>

    <Style x:Key="A_Style_RepeatButton_PivotTrack_ForegroundLeft"
           TargetType="{x:Type RepeatButton}"
           BasedOn="{StaticResource A_Style_RepeatButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Track Style="{StaticResource A_Style_Track_OptionsSlider}"
                           Height="{StaticResource A_Double_Thumb_Size}"
                           Minimum="{Binding Min}"
                           Maximum="{Binding Pivot}"
                           Value="{Binding Value}">
                        <Track.IncreaseRepeatButton>
                            <RepeatButton Style="{StaticResource A_Style_RepeatButton_Left}"/>
                        </Track.IncreaseRepeatButton>
                    </Track>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="A_Style_RepeatButton_PivotTrack_ForegroundRight"
           TargetType="{x:Type RepeatButton}"
           BasedOn="{StaticResource A_Style_RepeatButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Track Style="{StaticResource A_Style_Track_OptionsSlider}"
                           Height="{StaticResource A_Double_Thumb_Size}"
                           Minimum="{Binding Pivot}"
                           Maximum="{Binding Max}"
                           Value="{Binding Value}">
                        <Track.DecreaseRepeatButton>
                            <RepeatButton Style="{StaticResource A_Style_RepeatButton_Right}"/>
                        </Track.DecreaseRepeatButton>
                    </Track>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
        
    <ControlTemplate x:Key="A_ControlTemplate_PivotSlider" TargetType="SizedSlider">
        <DockPanel Margin="{TemplateBinding Padding}">
            <Decorator DockPanel.Dock="Right"
                    Width="{Binding (local:BindingProxy.AlwaysValidNumeric), RelativeSource={RelativeSource TemplatedParent}}">
                <local:FZTextBlock x:Name="PART_ValueText"
                                   Style="{StaticResource A_Style_FZTextBlock_Slider_Value}" />
            </Decorator>

            <Grid Width="{TemplateBinding SliderSize}">
                <local:FZMaterial x:Name="track_bg"
                                  Color="{StaticResource H_Color_Primary_Grey_70pc}"
                                  Height="6"
                                  Preset="{Roundtangle CornerRadius=3}"/>

                <Track Value="{Binding Pivot}" x:Name="Pivot_Foreground"
                       Style="{StaticResource A_Style_Track_OptionsSlider}">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton Style="{StaticResource A_Style_RepeatButton_PivotTrack_ForegroundLeft}"/>
                    </Track.DecreaseRepeatButton>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton Style="{StaticResource A_Style_RepeatButton_PivotTrack_ForegroundRight}"/>
                    </Track.IncreaseRepeatButton>
                </Track>

                <Track x:Name="DefaultIndicator" Style="{StaticResource A_Style_Track_OptionsSlider}" 
                       Value="{Binding Default}">
                    <Track.Thumb>
                        <Thumb Style="{StaticResource A_Style_Thumb_OptionsSlider_DefaultPositionIndicator}" Margin="0,0,0,-18"/>
                    </Track.Thumb>
                </Track>

                <Track x:Name="PART_Track"
                       Style="{StaticResource A_Style_Track_OptionsSlider}">
                    <Track.Thumb>
                        <Thumb x:Name="Thumb"
                               Style="{StaticResource A_Style_Thumb_OptionsSlider}" />
                    </Track.Thumb>
                </Track>
            </Grid>

        </DockPanel>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False" >
                <Setter TargetName="PART_ValueText" Property="Color" Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                <Setter TargetName="PART_ValueText" Property="Opacity" Value="{StaticResource A_Double_OptionsItemOpacity_Disabled}" />
                <Setter TargetName="track_bg" Property="Opacity" Value="0.2" />
                <Setter TargetName="track_bg" Property="Color" Value="{StaticResource A_Color_OptionsItem_Disabled}" />
            </Trigger>
            <Trigger Property="IsKeyboardFocusWithin" Value="True">
                <Setter TargetName="PART_ValueText" Property="Color" Value="{StaticResource A_Color_OptionsItem_Focused}" />
                <Setter TargetName="PART_ValueText" Property="local:ScreenReader.Line" Value="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    <ControlTemplate x:Key="A_ControlTemplate_MonoSlider" TargetType="SizedSlider">
        <DockPanel Margin="{TemplateBinding Padding}">
            <DockPanel DockPanel.Dock="Right">
                <Decorator DockPanel.Dock="Right"
                        Width="{Binding (local:BindingProxy.AlwaysValidNumeric), RelativeSource={RelativeSource TemplatedParent}}">
                    <local:FZTextBlock x:Name="PART_ValueText"
                                       Style="{DynamicResource A_Style_FZTextBlock_SizedSlider_Value}" />
                </Decorator>

                <Grid Width="{TemplateBinding SliderSize}">
                    <local:FZMaterial x:Name="track_bg"
                                      Color="{StaticResource H_Color_Primary_Grey_70pc}"
                                      Height="{StaticResource H_Slider_Track_Height}"
                                      Preset="{Roundtangle CornerRadius=3}"/>

                    <Decorator Visibility="{Binding Default, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource H_NumberToVisibilityConverter}}">
                        <Track x:Name="DefaultIndicator" Style="{StaticResource A_Style_Track_OptionsSlider}" 
                               Value="{Binding Default, RelativeSource={RelativeSource TemplatedParent}}">
                            <Track.Thumb>
                                <Thumb Style="{StaticResource A_Style_Thumb_OptionsSlider_DefaultPositionIndicator}" Margin="0,0,0,7"/>
                            </Track.Thumb>
                        </Track>
                    </Decorator>

                    <Track x:Name="PART_Track"
                           Style="{StaticResource A_Style_Track_OptionsSlider}">
                        <Track.DecreaseRepeatButton>
                            <RepeatButton x:Name="Left"
                                          Style="{StaticResource A_Style_RepeatButton_Right}"/>
                        </Track.DecreaseRepeatButton>
                        <Track.Thumb>
                            <Thumb x:Name="Thumb"
                                Margin="5,0"
                                          Style="{StaticResource A_Style_Thumb_OptionsSlider}" />
                        </Track.Thumb>
                    </Track>
                </Grid>

            </DockPanel>

            <Decorator>
                <local:FZTextBlock x:Name="PART_Label"
                                   Margin="{StaticResource H_Margin_Text_ListOption}"
                                   Style="{DynamicResource A_Style_FZTextBlock_SizedSlider_Label}"/>
            </Decorator>
        </DockPanel>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False" >
                <Setter TargetName="PART_Label" Property="Color" Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                <Setter TargetName="PART_Label" Property="Opacity" Value="{StaticResource A_Double_OptionsItemOpacity_Disabled}" />
                <Setter TargetName="PART_ValueText" Property="Color" Value="{StaticResource A_Color_OptionsItem_Disabled}" />
                <Setter TargetName="PART_ValueText" Property="Opacity" Value="{StaticResource A_Double_OptionsItemOpacity_Disabled}" />
            </Trigger>
            <Trigger Property="IsKeyboardFocusWithin" Value="True">
                <Setter TargetName="PART_Label" Property="Color" Value="{StaticResource A_Color_TextMenu_Text_Highlighted}" />
                <Setter TargetName="PART_Label" Property="local:ScreenReader.Line" Value="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}" />
                <Setter TargetName="PART_ValueText" Property="Color" Value="{StaticResource A_Color_TextMenu_Text_Highlighted}" />
                <Setter TargetName="PART_ValueText" Property="local:ScreenReader.Line" Value="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    <Style x:Key="A_Style_Slider_Options_Internal"
           TargetType="SizedSlider">
        <Setter Property="SliderSize"
                Value="368" />
        <Setter Property="SmallChange"
                Value="0.01" />
        <Setter Property="LargeChange"
                Value="0" />
        <Setter Property="Focusable"
                Value="True" />
        <Setter Property="Minimum"
                Value="0" />
        <Setter Property="Maximum"
                Value="1" />
        <Setter Property="IsMoveToPointEnabled"
                Value="True" />
        <Setter Property="local:BindingProxy.A"
                Value="{Binding Tag.Heading, RelativeSource={RelativeSource Self}}" />
        <Setter Property="local:BindingProxy.B"
                Value="{Binding Value, RelativeSource={RelativeSource Self}, Converter={StaticResource A_NumUnitConverter_Percent}}" />
        <Setter Property="local:BindingProxy.AlwaysValidNumeric"
                Value="69"/>
        <Setter Property="local:ScreenReader.SelectedNumber"
                Value="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}" />
        <Setter Property="local:ScreenReader.SelectedCount"
                Value="{Binding Items.Count, RelativeSource={RelativeSource AncestorType={x:Type Selector}}, FallbackValue=0}"/>

        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_MonoSlider}"/>
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Pivot, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="{StaticResource A_Boolean_True}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_PivotSlider}"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_Slider_Options_InItemsList"
           BasedOn="{StaticResource A_Style_Slider_Options_Internal}"
           TargetType="SizedSlider">
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="Height"
                Value="{StaticResource A_Double_TextMenu_Height_Default}" />
    </Style>

    <Style x:Key="A_Style_Slider_Options_WheelRotationAngle"
           BasedOn="{StaticResource A_Style_Slider_Options_InItemsList}"
           TargetType="SizedSlider">
        <Setter Property="local:BindingProxy.B"
                Value="{Binding Value, RelativeSource={RelativeSource Self}, Converter={StaticResource A_NumUnitConverter_Percent}}" />
        <Setter Property="SmallChange"
                Value="30" />
        <Setter Property="LargeChange"
                Value="0" />
        <Setter Property="Minimum"
                Value="270" />
        <Setter Property="Maximum"
                Value="900" />
        <Setter Property="IsMoveToPointEnabled"
                Value="True" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding CanChangeSteeringWheelRotationAngle}">
                <DataTrigger.Value>
                    <System:Boolean>False</System:Boolean>
                </DataTrigger.Value>
                <Setter Property="SmallChange"
                        Value="0" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_ListBoxItem_TextMenu_OptionsMenuItems"
                   BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_Gaps}"
                   TargetType="{Type ListBoxItem}">
        <!-- leaving IsEnabled alone lets us put focus on all items for scrolling and narration purposes. use Tag=Inactive for visual states -->
        <Setter Property="Focusable" Value="{Binding IsFocusable, FallbackValue=True}" />
        <Setter Property="ScreenReader.Event" Value="OnChange"/>
        <Setter Property="ScreenReader.LineType" Value="SelectedValue"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsEnabled}" Value="False">
                <Setter Property="Tag" Value="Inactive"/>
            </DataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsEnabled}" Value="False"/>
                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsKeyboardFocusWithin}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <!-- narrating 'value: currently locked' is consistent with how locked icons on focusable elements narrate in other menus across the game,
                     and our actual value contents (if any) from slider/spinner won't narrate when Tag=Inactive anyway! win-win.-->
                <Setter Property="ScreenReader.Line" Value="{Loc Main.IDS_ScreenReader_DimmedOption}"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_OptionsMenuPerformancePanelText"
           BasedOn="{StaticResource A_Style_FZTextBlock_DescriptionBlockBody}"
           TargetType="{Type FZTextBlock}">
        <Setter Property="FontFamily" Value="Horizon_D_tf"/>
        <Setter Property="Margin" Value="0,8"/>
        <Setter Property="CapHeight" Value="12"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
    </Style>

    <local:MappingConverter x:Key="A_MappingConverter_Color_FromBudgetExceeded" Default="{StaticResource H_Color_Secondary_Positive}">
        <local:MappingConverterEntry Key="True" Value="{StaticResource H_Color_Secondary_Negative}" />
    </local:MappingConverter>

    <Style TargetType="{x:Type ProgressBar}"
           x:Key="A_Style_ProgressBar_MemoryUsageBar">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <Grid>
                        <FZMaterial Color="#55000000"
                                    Preset="{Roundtangle CornerRadius=2}"
                                    x:Name="PART_Track"/>
                        <FZMaterial Color="{Binding (local.BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_MappingConverter_Color_FromBudgetExceeded}}"
                                    Preset="{Roundtangle CornerRadius=2}"
                                    HorizontalAlignment="Left"
                                    x:Name="PART_Indicator"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate DataType="{x:Type local:OptionsMenuPerformancePanel}">
        <Grid>
            <local:FZMaterial Style="{StaticResource H_Style_Container_GlassHighBlur_Description}">
                <StackPanel Margin="10,4">
                    <UniformGrid Columns="4" Rows="2">
                        <FZTextBlock Text="{Loc MyProfile.IDS_CPU}" Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}"/>
                        <FZTextBlock Text="{Binding CPUTimingText}" Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}" HorizontalAlignment="Right"/>
                        <FZTextBlock Text="{Loc MyProfile.IDS_Frame}" Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}" AutoScroll="{StaticResource H_AutoScrollSettings_Horizontal_Title}" TextAlignment="Center" Margin="8,8"/>
                        <FZTextBlock Text="{Binding FrameTimingText}" Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}" HorizontalAlignment="Right"/>
                        <FZTextBlock Text="{Loc MyProfile.IDS_GPU}" Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}"/>
                        <FZTextBlock Text="{Binding GPUTimingText}" Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}" HorizontalAlignment="Right"/>
                        <Decorator/>
                        <FZTextBlock Text="{Binding FPSText}" Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}" HorizontalAlignment="Right"/>
                    </UniformGrid>
                    <StackPanel Margin="0,10,0,0">
                        <FZTextBlock Text="{Loc MyProfile.IDS_VideoMemory}"  Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}" AutoScroll="{StaticResource H_AutoScrollSettings_Horizontal_Title}"/>
                        <FZTextBlock Text="{Binding VideoMemoryUsageText}" Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}" TextAlignment="Left" Margin="0,2,0,10" />
                    </StackPanel>
                    <ProgressBar Style="{StaticResource A_Style_ProgressBar_MemoryUsageBar}" Height ="16"
                         Minimum="0"
                         Maximum="1"
                         Value="{Binding VideoMemoryUsageRatio}"
                         Margin="0,0,0,4"
                         local:BindingProxy.A="{Binding IsVideoMemoryUsageOverBudget}"/>
                    <StackPanel Margin="0,10,0,0">
                        <FZTextBlock Text="{Loc Benchmark.IDS_SystemMemory}"  Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}" AutoScroll="{StaticResource H_AutoScrollSettings_Horizontal_Title}"/>
                        <FZTextBlock Text="{Binding SystemMemoryUsageText}" Style="{StaticResource A_Style_FZTextBlock_OptionsMenuPerformancePanelText}" TextAlignment="Left" Margin="0,2,0,10" />
                    </StackPanel>
                    <ProgressBar Style="{StaticResource A_Style_ProgressBar_MemoryUsageBar}" Height ="16"
                         Minimum="0"
                         Maximum="1"
                         Value="{Binding SystemMemoryUsageRatio}"
                         Margin="0,0,0,4"
                         local:BindingProxy.A="{Binding IsSystemMemoryUsageOverSystemMemory}"/>
                </StackPanel>
            </local:FZMaterial>
        </Grid>
    </DataTemplate>

</ResourceDictionary>
