<TuneMenu DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Style="{StaticResource A_Style_Page_Generic}"
      mc:Ignorable="d"
      x:Class="ForzaUI.Scenes.Anthem.A_TuningOptions"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:ForzaUI"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Menu}" />
    </local:UIPageTransitionManager.TransitionManager>
    <Page.Resources>
        <ResourceDictionary>
            <BitmapImage UriSource="/ForzaUI;component/Textures/Anthem/Icons/Pad_Lock.png" x:Key="A_ImageSource_PadlockIcon" />
            <Style x:Key="A_Style_FZMaterial_TextMenu_LockIcon_Preload" 
                   TargetType="{x:Type local:FZMaterial}" 
                   BasedOn="{StaticResource A_Style_FZMaterial_TextMenu_LockIcon}">
                <Setter Property="ImageSource" Value="{StaticResource A_ImageSource_PadlockIcon}" />
            </Style>
            <Style BasedOn="{StaticResource A_Style_FrameworkElement_DefaultTransition}"
                   TargetType="DockPanel"
                   x:Key="A_Style_DockPanel_SideBlock">
                <Setter Property="Height"
                        Value="752" />
            </Style>
            <Style BasedOn="{StaticResource A_Style_FZTextBlock_Body}"
                   TargetType="local:FZTextBlock"
                   x:Key="A_Style_FZTextBlock_Tuning_DescriptionBlockBody">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_Body_Text}" />
                <Setter Property="TextWrapping"
                        Value="Wrap" />
                <Setter Property="Stretch"
                        Value="None" />
                <Setter Property="Margin"
                        Value="0,7,0,0" />
            </Style>
            <Style BasedOn="{StaticResource A_Style_FZTextBlock_OptionText}"
                   TargetType="local:FZTextBlock"
                   x:Key="A_Style_FZTextBlock_Tune_ItemLabel">
                <Setter Property="Margin"
                        Value="0" />
                <Setter Property="VerticalAlignment"
                        Value="Center" />
                <Setter Property="FontFamily"
                        Value="Horizon_B" />
            </Style>
            <Style BasedOn="{StaticResource A_Style_FZTextBlock_OptionText}"
                   TargetType="local:FZTextBlock"
                   x:Key="A_Style_FZTextBlock_Tune_ItemValue">
                <Setter Property="FontFamily"
                        Value="Horizon_C_tf" />
                <Setter Property="local:ScreenReader.Event"
                        Value="OnChange"/>
                <Setter Property="local:ScreenReader.LineType"
                        Value="SelectedValue"/>
            </Style>
            <System:Double x:Key="A_Double_Tuning_SliderWidth">324</System:Double>
            <System:Double x:Key="A_Double_Tuning_ValueWidth">62</System:Double>
            <Style TargetType="FrameworkElement"
                   x:Key="A_Style_TuningSliderColumn">
                <Setter Property="Width"
                        Value="{StaticResource A_Double_Tuning_SliderWidth}" />
                <Setter Property="DockPanel.Dock"
                        Value="Right" />
            </Style>
            <Style TargetType="FrameworkElement"
                   x:Key="A_Style_TuningValueColumn">
                <Setter Property="Width"
                        Value="{StaticResource A_Double_Tuning_ValueWidth}" />
                <Setter Property="DockPanel.Dock"
                        Value="Right" />
            </Style>
            <Style TargetType="DockPanel"
                   x:Key="A_Style_DockPanel_1x3_TuningSpaced">
                <Setter Property="Height"
                        Value="{StaticResource A_Double_TextMenu_Height_Default}" />
                <Setter Property="VerticalAlignment"
                        Value="Center" />
            </Style>
            <Style BasedOn="{StaticResource A_Style_ListBox_List_Default}"
                   TargetType="{x:Type local:CommonListBox}"
                   x:Key="A_Style_ListBox_List_Tuning">
                <Setter Property="Focusable"
                        Value="False" />
                <Setter Property="AllowMouseWheelScrolling"
                        Value="False" />
            </Style>
            <Style BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_NotFocusable}"
                   TargetType="ListBoxItem"
                   x:Key="A_Style_ListBoxItem_List_Tuning">
                <Setter Property="Margin" Value="0,0,0,4" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsHeader}">
                        <DataTrigger.Value>
                            <System:Boolean>True</System:Boolean>
                        </DataTrigger.Value>
                        <Setter Property="Tag"
                                Value="GroupHeader" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_Thumb_OptionsSlider_History"
                   TargetType="{x:Type Thumb}">
                <Setter Property="Width" Value="0"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Thumb}">
                            <Grid Width="0" Height="0">
                                <Grid x:Name="thumb"
                                    Width="{StaticResource A_Double_Thumb_Size}"
                                    Height="{StaticResource A_Double_Thumb_Size}"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center">
                                    <local:FZMaterial x:Name="OuterMaterial" 
                                        Color="{StaticResource H_Color_Primary_Grey_70pc}"
                                        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>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_RepeatButton_Right_Tuning"
                   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="{StaticResource 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>
                                <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>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_RepeatButton_Left_Tuning"
                   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="{StaticResource H_Slider_Track_Height}"
                                                  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>
                                <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>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>


            <Style x:Key="A_Style_Slider_Tuning_Internal"
                   TargetType="SizedSlider">
                <Setter Property="Focusable"
                        Value="True" />
                <Setter Property="SmallChange"
                        Value="{Binding SmallChange}" />
                <Setter Property="LargeChange"
                        Value="{Binding LargeChange}" />
                <Setter Property="Minimum"
                        Value="{Binding Minimum}" />
                <Setter Property="Maximum"
                        Value="{Binding Maximum}" />
                <Setter Property="Value"
                        Value="{Binding Value, Mode=TwoWay}" />
                <Setter Property="IsMoveToPointEnabled"
                        Value="True" />
                <Setter Property="local:BindingProxy.TunnelOut"
                        Value="{Binding (local:BindingProxy.C), RelativeSource={RelativeSource AncestorType=ListBoxItem}, Mode=OneWayToSource}" />
                <Setter Property="local:BindingProxy.TunnelIn">
                    <Setter.Value>
                        <!-- Turn off streak shadows for the contents of the list box item, we need to do it ourselves.
                     Look for a trigger to BindingProxy.C in A_ControlTemplate_TextMenu_Default -->
                        <System:Boolean>False</System:Boolean>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="SizedSlider">
                            <Grid FocusManager.IsFocusScope="True"
                                  Margin="{TemplateBinding Padding}">

                                <local:FZMaterial x:Name="track_bg"
                                                  Color="{StaticResource H_Color_Primary_Grey_70pc}"
                                                  Height="{StaticResource H_Slider_Track_Height}"
                                                  Preset="{Roundtangle CornerRadius=3}"/>
                                <local:FZMaterial Width="12"
                                                  Height="8"
                                                  x:Name="Centre"
                                                  Margin="0,0,0,5"
                                                  HorizontalAlignment="Center"
                                                  VerticalAlignment="Bottom"
                                                  Visibility="Collapsed"
                                                  Color="{StaticResource H_Color_Primary_Grey_70pc}"
                                                  ImageSource="/ForzaUI;component/Textures/Anthem/A_Slider_Center.png" />

                                <Track Style="{StaticResource A_Style_Track_OptionsSlider}"
                                       Value="{Binding History}"
                                       Margin="5,0"
                                       Tag="{Binding IsReadOnly}">
                                    <Track.Thumb>
                                        <Thumb Style="{StaticResource A_Style_Thumb_OptionsSlider_History}"/>
                                    </Track.Thumb>
                                </Track>
                                
                                <Track x:Name="MonoTrack"
                                       Style="{StaticResource A_Style_Track_OptionsSlider}"
                                       Value="{Binding Value, ElementName=PART_Track}">
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton x:Name="Left"
                                                      Style="{StaticResource A_Style_RepeatButton_Left_Tuning}"  />
                                    </Track.DecreaseRepeatButton>
                                </Track>

                                <Grid IsHitTestVisible="False"
                                      x:Name="BidiTrack"
                                      Visibility="Hidden">
                                    <UniformGrid Columns="2" x:Name="Bidi_Foreground">
                                        <Track Style="{StaticResource A_Style_Track_OptionsSlider}"
                                               Value="{Binding Value, ElementName=PART_Track}"
                                               Maximum="{Binding Middle}">
                                            <Track.IncreaseRepeatButton>
                                                <RepeatButton Style="{StaticResource A_Style_RepeatButton_Left_Tuning}" />
                                            </Track.IncreaseRepeatButton>
                                        </Track>
                                        <Track Style="{StaticResource A_Style_Track_OptionsSlider}"
                                               Value="{Binding Value, ElementName=PART_Track}"
                                               Minimum="{Binding Middle}">
                                            <Track.DecreaseRepeatButton>
                                                <RepeatButton Style="{StaticResource A_Style_RepeatButton_Right_Tuning}"  />
                                            </Track.DecreaseRepeatButton>
                                        </Track>
                                    </UniformGrid>
                                </Grid>

                                <Track x:Name="PART_Track"
                                       Style="{StaticResource A_Style_Track_OptionsSlider}"
                                       Margin="5,0"
                                       Tag="{Binding IsReadOnly}">
                                    <Track.Thumb>
                                        <Thumb x:Name="Thumb"
                                               Style="{StaticResource A_Style_Thumb_OptionsSlider}"/>
                                    </Track.Thumb>
                                </Track>
                                
                            </Grid>
                            <ControlTemplate.Triggers>
                                <DataTrigger Binding="{Binding Bidirectional}"
                                             Value="True">
                                    <Setter TargetName="BidiTrack"
                                            Property="Visibility"
                                            Value="Visible" />
                                    <Setter TargetName="MonoTrack"
                                            Property="Visibility"
                                            Value="Hidden" />
                                    <Setter TargetName="Centre"
                                            Property="Visibility"
                                            Value="Visible" />
                                    
                                    <Setter TargetName="Left"
                                            Property="Style"
                                            Value="{StaticResource A_Style_RepeatButton_Right}" />
                                </DataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding IsReadOnly, FallbackValue=False}" Value="True" />
                                        <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=IsKeyboardFocusWithin}" Value="True" />
                                    </MultiDataTrigger.Conditions>
                                    <Setter TargetName="Centre" Property="Color" Value="{StaticResource A_Color_ReadOnlySlider_Highlighted}"/>
                                </MultiDataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="local:ScreenReader.Line"
                        Value="{Binding Title}"/>
                <Setter Property="local:ScreenReader.LineType"
                        Value="SelectedItem"/>
                <Setter Property="local:ScreenReader.Event"
                        Value="OnFocus"/>
                <Setter Property="local:ScreenReader.ControlType"
                        Value="Spinner"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsReadOnly}"
                                 Value="True">
                        <Setter Property="IsHitTestVisible"
                                Value="False" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_Slider_Tuning_InItemsList"
                   BasedOn="{StaticResource A_Style_Slider_Tuning_Internal}"
                   TargetType="SizedSlider">
                <Setter Property="Padding"
                        Value="18,0" />
                <Setter Property="Height"
                        Value="{StaticResource A_Double_TextMenu_Height_Default}" />
                <Setter Property="FocusSelf.WhenTrue"
                        Value="{Binding IsFocused, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=False}"/>

            </Style>

            <Style BasedOn="{StaticResource A_Style_FZTextBlock_Heading_Small_Tight}"
                   TargetType="local:FZTextBlock"
                   x:Key="A_Style_FZTextBlock_Dyno_Label">
                <Setter Property="Color"
                        Value="{StaticResource H_Color_Primary_White}" />
                <Setter Property="FontFamily"
                        Value="Horizon_A" />
                <Setter Property="CapHeight"
                        Value="14" />
                <Setter Property="FontSize"
                        Value="{StaticResource A_Double_FontSize_Minimum}" />
                <Setter Property="FontFamily"
                        Value="Horizon_D" />
            </Style>
            <Style BasedOn="{StaticResource A_Style_FZTextBlock_Heading_Small_Tight}"
                   TargetType="local:FZTextBlock"
                   x:Key="A_Style_FZTextBlock_Dyno_Legend">
                <Setter Property="Color"
                        Value="White" />
                <Setter Property="FontFamily"
                        Value="Horizon_D" />
                <Setter Property="CapHeight"
                        Value="13" />
                <Setter Property="Stretch"
                        Value="None" />
                <Setter Property="Opacity"
                        Value="0.5" />
            </Style>
            <Style TargetType="{x:Type local:FZMaterial}"
                   x:Key="A_Style_Material_DynoBorder">
                <Setter Property="Color"
                        Value="White" />
                <Setter Property="Opacity"
                        Value="1" />
            </Style>
            <SolidColorBrush Color="White"
                             x:Key="A_Brush_DynoGraphLine" />
            <Style TargetType="{x:Type Path}"
                   x:Key="A_Style_Path_DynoGraphVertLine">
                <Setter Property="Data"
                        Value="M0,0 L0,-458" />
                <Setter Property="Stroke"
                        Value="{StaticResource A_Brush_DynoGraphLine}" />
                <Setter Property="StrokeThickness"
                        Value="1" />
                <Setter Property="Opacity"
                        Value="0.3" />
                <Setter Property="StrokeEndLineCap"
                        Value="Square" />
                <Setter Property="VerticalAlignment"
                        Value="Bottom" />
                <Setter Property="HorizontalAlignment"
                        Value="Right" />
            </Style>
            <Style TargetType="{x:Type Path}"
                   x:Key="A_Style_Path_DynoGraphHorzLine">
                <Setter Property="Data"
                        Value="M0,0 L1920,0" />
                <Setter Property="Stroke"
                        Value="{StaticResource A_Brush_DynoGraphLine}" />
                <Setter Property="StrokeThickness"
                        Value="1" />
                <Setter Property="Opacity"
                        Value="0.3" />
                <Setter Property="StrokeEndLineCap"
                        Value="Square" />
                <Setter Property="VerticalAlignment"
                        Value="Bottom" />
            </Style>
            <Style x:Key="A_Style_FZTextBlock_AutoScroll_TuningDescription" BasedOn="{StaticResource A_Style_FZTextBlock_Tuning_DescriptionBlockBody}" TargetType="FZTextBlock">
                <Setter Property="AutoScroll" Value="{StaticResource H_AutoScrollSettings_Descriptions}" />
                <Setter Property="AutoScroll.AllowScrolling" Value="True" />
                <Setter Property="Margin" Value="22" />
            </Style>
            <DataTemplate DataType="{x:Type local:SliderViewModel}">
                <Grid>
                    <DockPanel Margin="0,2,0,0" Height="48" Style="{StaticResource A_Style_DockPanel_1x3_TuningSpaced}">
                        <Grid Style="{StaticResource A_Style_TuningValueColumn}">
                            <Grid Margin="0,0,16,0"
                                      HorizontalAlignment="Right">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Tune_ItemValue}"
                                                    Text="{Binding Text}"
                                                    Margin="0"
                                                    x:Name="Value" />
                                <local:FZMaterial x:Name="LockIcon" Style="{StaticResource A_Style_FZMaterial_TextMenu_LockIcon_Preload}"
                                                    Visibility="{Binding IsReadOnly, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Hidden}"
                                                    Margin="0,-16,0,-16" />
                            </Grid>
                        </Grid>
                        <Grid Style="{StaticResource A_Style_TuningSliderColumn}">
                            <SizedSlider Tag="{Binding IsReadOnly}" Style="{StaticResource A_Style_Slider_Tuning_InItemsList}" />
                        </Grid>
                        <local:FZTextBlock HorizontalAlignment="Left"
                                        Margin="20,0,0,0"
                                        Style="{StaticResource A_Style_FZTextBlock_Tune_ItemLabel}"
                                        Text="{Binding Title}" />
                    </DockPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsReadOnly, FallbackValue=False}" Value="True">
                        <Setter TargetName="LockIcon" Property="Color" Value="{StaticResource A_Color_ReadOnlySlider}" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsReadOnly, FallbackValue=False}" Value="True"/>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=IsKeyboardFocusWithin}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="LockIcon" Property="Color" Value="{StaticResource A_Color_ReadOnlySlider_Highlighted}"/>
                        <Setter TargetName="Value" Property="local:ScreenReader.LineType" Value="ItemState" />
                        <Setter TargetName="Value" Property="local:ScreenReader.Line" Value="{Binding SelectedItem.UnlockHelp, ElementName=PART_OptionList}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsReadOnly, FallbackValue=False}" Value="False"/>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=IsKeyboardFocusWithin}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="Value" Property="local:ScreenReader.Line" Value="{Binding Text, RelativeSource={RelativeSource Self}}" />
                    </MultiDataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>
            <DataTemplate DataType="{x:Type local:TuningHeader}">
                <Grid>
                    <local:FZMaterial Color="{StaticResource H_Color_Primary_Green}" Preset="{Roundtangle CornerRadius=2}"/>
                    <DockPanel Style="{StaticResource A_Style_DockPanel_1x3_TuningSpaced}">
                        <Grid Style="{StaticResource A_Style_TuningValueColumn}">
                            <local:FZTextBlock HorizontalAlignment="Right"
                                               Margin="0,0,20,0"
                                               Style="{StaticResource H_Style_Text_DescriptionTitle}"
                                               Text="{Binding Units, Converter={StaticResource A_StringToUpper}}" />
                        </Grid>
                        <DockPanel Style="{StaticResource A_Style_TuningSliderColumn}">
                            <local:FZTextBlock HorizontalAlignment="Left"
                                               Style="{StaticResource H_Style_Text_DescriptionTitle}"
                                               Text="{Binding Min}" 
                                               DockPanel.Dock="Left"/>
                            <local:FZTextBlock HorizontalAlignment="Right"
                                               Style="{StaticResource H_Style_Text_DescriptionTitle}"
                                               Text="{Binding Max}" 
                                               DockPanel.Dock="Right"/>
                        </DockPanel>
                        <local:FZTextBlock HorizontalAlignment="Left"
                                           Style="{StaticResource H_Style_Text_DescriptionTitle}"
                                           Margin="20,0,0,0"
                                           Text="{Binding Title}" />
                    </DockPanel>
                </Grid>
            </DataTemplate>

            <local:LinearTransformConverter Add="-2"
                                            x:Key="A_Converter_SelectedGearToGraphIndex" />

            <Style x:Key="A_Style_TransGraphRenderer_Tuning"
                   TargetType="{x:Type local:TransGraphRenderer}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SelectedIndex, ElementName=PART_ChassisTuningGroupList}"
                                 Value="1">
                        <Setter Property="SelectGear"
                                Value="{Binding SelectedIndex, ElementName=PART_OptionList, Converter={StaticResource A_Converter_SelectedGearToGraphIndex}}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_VisibleWhenGearing"
                   TargetType="{x:Type FrameworkElement}">
                <Setter Property="Visibility"
                        Value="Collapsed" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SelectedIndex, ElementName=PART_ChassisTuningGroupList}"
                                 Value="1">
                        <Setter Property="Visibility"
                                Value="Visible" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_VisibleWhenAero" TargetType="{x:Type FrameworkElement}">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding SelectedIndex, ElementName=PART_ChassisTuningGroupList}"
                     Value="6">
                        <Setter Property="Visibility"
                    Value="Visible" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            
            <Style x:Key="A_Style_TuneHelp_Bold"
                   TargetType="{x:Type local:FZRun}">
                <Setter Property="FontFamily"
                        Value="Horizon_C" />
            </Style>

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

            <Style x:Key="A_Style_FZMaterial_Tuning_BenchMarkDivider" TargetType="{x:Type local:FZMaterial}" >
                <Setter Property="Height" Value="2" />
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Grey_70pc}"/>
                <Setter Property="Preset" Value="{Roundtangle CornerRadius=2}"/>
            </Style>
            <Style x:Key="A_Style_FZMaterial_Tuning_BenchMarkStatsDivider" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkDivider}">
                <Setter Property="Opacity" Value="0.5"/>
            </Style>

            <ControlTemplate x:Key="A_ControlTemplate_TopBottom_Dividers" TargetType="{x:Type Control}">
                <Grid>
                    <local:FZMaterial x:Name="TopDivider" VerticalAlignment="Top" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkDivider}" />
                    <local:FZMaterial x:Name="BottomDivider" VerticalAlignment="Bottom" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkDivider}" />
                </Grid>
            </ControlTemplate>

            <ControlTemplate TargetType="Control" x:Key="A_Template_Control_Benchmark">
                <ControlTemplate.Resources>
                    <GridLength x:Key="A_GridLength_BenchmarkRowHeight">47.5</GridLength>
                    <GridLength x:Key="A_GridLength_BenchmarkDividerHeight">2</GridLength>
                    <GridLength x:Key="A_GridLength_BenchmarkPanelSeparationHeight">4</GridLength>
                </ControlTemplate.Resources>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition x:Name="BrakingDistancePanel" Height="Auto" />
                        <RowDefinition Height="*" />
                        <RowDefinition x:Name="LateralGsPanel" Height="Auto" />
                        <RowDefinition Height="*" />
                        <RowDefinition x:Name="AccelerationandSpeedPanel" Height="Auto" />
                        <RowDefinition Height="*" />
                        <RowDefinition x:Name="MiscellaneousPanel" Height="Auto" />
                    </Grid.RowDefinitions>
                    <local:FZMaterial Grid.Row="0" Style="{StaticResource H_Style_Container_GlassHighBlur_Description}">
                        <Grid Margin="18,0">
                            <Grid.RowDefinitions>
                                <RowDefinition x:Name="BrakingDistance" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="60To0" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="100To0" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                            </Grid.RowDefinitions>
                            <local:FZTextBlock Grid.Row="0" VerticalAlignment="Center" Text="{local:Loc Benchmark.IDS_BRAKING_DISTANCE}"
                                        Style="{StaticResource A_Style_TextBlock_BenchmarkSectionHeader}" />
                            <local:FZMaterial Grid.Row="1" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkDivider}" />
                            <local:FZTextBlock Grid.Row="2" Text="{Binding Brake60Label}"
                                        Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="2" Text="{Binding Brake60Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                            <local:FZMaterial Grid.Row="3" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkStatsDivider}" />
                            <local:FZTextBlock Grid.Row="4" Text="{Binding Brake100Label}"
                                       Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="4" Text="{Binding Brake100Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                        </Grid>
                    </local:FZMaterial>
                    <local:FZMaterial Grid.Row="2" Style="{StaticResource H_Style_Container_GlassHighBlur_Description}">
                        <Grid Margin="18,0">
                            <Grid.RowDefinitions>
                                <RowDefinition x:Name="LateralGs" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="Lat60" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="Lat120" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                            </Grid.RowDefinitions>
                            <local:FZTextBlock Grid.Row="0" VerticalAlignment="Center" Text="{local:Loc Benchmark.IDS_LATERAL_Gs}"
                                            Style="{StaticResource A_Style_TextBlock_BenchmarkSectionHeader}" />
                            <local:FZMaterial Grid.Row="1" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkDivider}" />
                            <local:FZTextBlock Grid.Row="2" Text="{Binding LatG60Label}"
                                       Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="2" Text="{Binding LatG60Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                            <local:FZMaterial Grid.Row="3" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkStatsDivider}" />
                            <local:FZTextBlock Grid.Row="4" Text="{Binding LatG120Label}"
                                       Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="4" Text="{Binding LatG120Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                        </Grid>
                    </local:FZMaterial>
                    <local:FZMaterial Grid.Row="4" Style="{StaticResource H_Style_Container_GlassHighBlur_Description}">
                        <Grid Margin="18,0">
                            <Grid.RowDefinitions>
                                <RowDefinition x:Name="AccelerationAndSpeed" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="0To60" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="0To100" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="TopSpeed" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                            </Grid.RowDefinitions>
                            <local:FZTextBlock Grid.Row="0" VerticalAlignment="Center" Text="{local:Loc Benchmark.IDS_ACCELERATION_SPEED}"
                                        Style="{StaticResource A_Style_TextBlock_BenchmarkSectionHeader}" />
                            <local:FZMaterial Grid.Row="1" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkDivider}" />
                            <local:FZTextBlock Grid.Row="2" Text="{Binding Accel60Label}"
                                       Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="2" Text="{Binding Accel60Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                            <local:FZMaterial Grid.Row="3" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkStatsDivider}" />
                            <local:FZTextBlock Grid.Row="4" Text="{Binding Accel100Label}"
                                       Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="4" Text="{Binding Accel100Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                            <local:FZMaterial Grid.Row="5" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkStatsDivider}" />
                            <local:FZTextBlock Grid.Row="6" Text="{local:Loc Benchmark.IDS_TopSpeed}"
                                       Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="6" Text="{Binding TopSpeedStat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                        </Grid>
                    </local:FZMaterial>
                    <local:FZMaterial Grid.Row="6" Style="{StaticResource H_Style_Container_GlassHighBlur_Description}">
                        <Grid Margin="18,0">
                            <Grid.RowDefinitions>
                                <RowDefinition x:Name="Miscellaneous" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="RoadBalance" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="AeroBalance" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                                <RowDefinition Height="{StaticResource A_GridLength_BenchmarkDividerHeight}" />
                                <RowDefinition x:Name="AeroEfficiency" Height="{StaticResource A_GridLength_BenchmarkRowHeight}" />
                            </Grid.RowDefinitions>
                            <local:FZTextBlock Grid.Row="0" VerticalAlignment="Center" Text="{local:Loc Benchmark.IDS_Miscellaneous}"
                                        Style="{StaticResource A_Style_TextBlock_BenchmarkSectionHeader}" />
                            <local:FZMaterial Grid.Row="1" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkDivider}" />
                            <local:FZTextBlock Grid.Row="2" Text="{local:Loc Benchmark.IDS_RoadBalance}"
                                        Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="2" Text="{Binding RoadBalance}"
                                        Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                            <local:FZMaterial Grid.Row="3" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkStatsDivider}" />
                            <local:FZTextBlock Grid.Row="4" Text="{local:Loc Benchmark.IDS_AeroBalance}"
                                        Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="4" Text="{Binding AeroBalance}"
                                        Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                            <local:FZMaterial Grid.Row="5" VerticalAlignment="Center" Style="{StaticResource A_Style_FZMaterial_Tuning_BenchMarkStatsDivider}" />
                            <local:FZTextBlock Grid.Row="6" Text="{local:Loc Benchmark.IDS_AeroEfficiency}"
                                        Style="{StaticResource A_Style_FZTextBlock_StatLabel}" />
                            <local:FZTextBlock Grid.Row="6" Text="{Binding AeroEfficiency}"
                                        Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                        </Grid>
                    </local:FZMaterial>
                </Grid>
            </ControlTemplate>

            <Style x:Key="A_Style_EmptyItem_Tuning" TargetType="{x:Type Control}">
                <Setter Property="Focusable" Value="False" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Decorator Height="{StaticResource A_Double_TextMenu_Height_Default}" Margin ="0, 0, 0, 4">
                                <local:FZMaterial
                                        Preset="{Roundtangle CornerRadius=2}"
                                        Color="#30111111"
                                        />
                            </Decorator>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <ControlTemplate x:Key="A_ControlTemplate_ListBox_Tuning" TargetType="{x:Type ListBox}">
                <DockPanel>
                    <FZScrollViewer Style="{StaticResource A_Style_ScrollViewer_TextMenu}"
                            Template="{StaticResource A_ControlTemplate_ScrollViewer_TextMenu}"
                            CanContentScroll="True"
                            HorizontalScrollBarVisibility="Disabled"
                            VerticalScrollBarVisibility="{Binding (ScrollViewer.VerticalScrollBarVisibility), RelativeSource={RelativeSource TemplatedParent}}"
                            IsAtTop="{Binding (local:FZScrollViewer.IsAtTop), Mode=OneWayToSource, RelativeSource={RelativeSource TemplatedParent}}"
                            IsAtBottom="{Binding (local:FZScrollViewer.IsAtBottom), Mode=OneWayToSource, RelativeSource={RelativeSource TemplatedParent}}"
                            Focusable="False"
                            KeepSelectionOnScreen="True"
                            DragMovementMultiplier="0.03"
                            VerticalAlignment="Top"
                            x:Name="ScrollViewer"
                            DockPanel.Dock="Top">
                        <VirtualizingStackPanel Margin="{DynamicResource A_Thickness_ListBox_TextMenu_PanelMargin_Dynamic}"
                            Orientation="Vertical"
                            IsItemsHost="True"
                            VirtualizationMode="Recycling"
                            Focusable="False" />
                    </FZScrollViewer>
                    <StackPanel ClipToBounds="True" x:Name="EmptyItems">
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                        <Control Style="{StaticResource A_Style_EmptyItem_Tuning}" />
                    </StackPanel>
                </DockPanel>
            </ControlTemplate>
        </ResourceDictionary>
    </Page.Resources>
    <Grid>
        <!-- Background Blur -->
       <Control Style="{StaticResource A_Style_Control_ScreenBackground}" />
        <!-- Bars -->
        <local:PlayerBarControl Style="{StaticResource A_Style_PlayerBarControl}"
                                x:Name="TopBar" />
        <ContentControl Style="{StaticResource A_Style_ButtonBar}"
                        x:Name="BottomBar">
            <ContentControl Name="PART_DefaultHelpPanel"
                            Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}"
                            local:ControllerButtonPanel.BDescription="{local:Loc HelpButtons.IDS_Back}"
                            local:ControllerButtonPanel.XDescription="{local:Loc ScreenTitles.IDS_UpgradeCarMainTitle}"
                            local:ControllerButtonPanel.YDescription="{local:Loc HelpButtons.IDS_Test_Drive}" />
        </ContentControl>
        <Border Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}" x:Name="PART_LayoutRoot" Padding="88,0,88,18">
            <Grid VerticalAlignment="Center">
                <StackPanel>
                    <StackPanel Style="{StaticResource A_Style_FrameworkElement_DefaultTransition}"
                                local:UIPageTransitionManager.TransitionIndex="0">
                        <ContentControl Content="{local:Loc ScreenTitles.IDS_TuneCar}"
                                        HorizontalAlignment="Left"
                                        Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                        local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/Tuning.png" />
                    </StackPanel>
                    <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}"
                               VerticalAlignment="Top">
                        <FZTabButtonsSelector
                            Grid.Column="2"
                            ItemsSource="{Binding Categories}"
                            PageSize="1"
                            SelectedIndex="-1"
                            MaxWidth="1744"
                            HorizontalContentAlignment="Center"
                            Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=Grid}}"
                            Style="{StaticResource H_Style_TabBar}"
                            x:Name="PART_ChassisTuningGroupList" />
                    </Decorator>
                    <DockPanel HorizontalAlignment="Stretch"
                               VerticalAlignment="Top">
                        <!-- Left-hand-side Panel; Benchmark -->
                        <DockPanel Style="{StaticResource A_Style_DockPanel_SideBlock}"
                                   Width="428"
                                   local:UIPageTransitionManager.TransitionIndex="2">

                            <DockPanel>
                                <ContentControl DockPanel.Dock="Top" Content="{local:Loc Tuning.IDS_Performance}" Style="{StaticResource A_Style_DescriptionPanelHeader}"/>
                                <Control x:Name="Panel_BenchmarkInfo"
                                     DockPanel.Dock="Top"
                                     Template="{StaticResource A_Template_Control_Benchmark}"
                                     DataContext="{Binding Benchmark}" />
                            </DockPanel>
                        </DockPanel>
                        <!-- Right-hand-side Panel; Description & Gearing Ratios-->
                        <DockPanel DockPanel.Dock="Right"
                                   Style="{StaticResource A_Style_DockPanel_SideBlock}"
                                   Width="428"
                                   local:UIPageTransitionManager.TransitionIndex="4">
                            <!-- Gearing Ratios -->
                            <StackPanel DockPanel.Dock="Bottom"
                                        Margin="0,4,0,0"
                                        Orientation="Vertical"
                                        Style="{StaticResource A_Style_VisibleWhenGearing}">
                                <Grid>
                                    <local:FZMaterial Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"/>
                                    <Grid Margin="30,22,29,16">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="17" />
                                            <ColumnDefinition Width="18" />
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="*" />
                                            <RowDefinition Height="24" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <local:FZMaterial Grid.Column="2"
                                                          Grid.Row="0"
                                                          Style="{StaticResource A_Style_Material_DynoBorder}"
                                                          Width="1"
                                                          HorizontalAlignment="Left" />
                                        <local:FZMaterial Grid.Column="2"
                                                          Grid.Row="0"
                                                          Style="{StaticResource A_Style_Material_DynoBorder}"
                                                          Height="1"
                                                          VerticalAlignment="Bottom" />
                                        <local:FZMaterial Grid.Column="2"
                                                          Grid.Row="0"
                                                          Style="{StaticResource A_Style_Material_DynoBorder}"
                                                          Width="1"
                                                          Opacity="0.3"
                                                          HorizontalAlignment="Right" />
                                        <UniformGrid ClipToBounds="True"
                                                     Margin="2,0,0,0"
                                                     Grid.Column="2"
                                                     Grid.Row="0"
                                                     Rows="8">
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphHorzLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphHorzLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphHorzLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphHorzLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphHorzLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphHorzLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphHorzLine}" />
                                        </UniformGrid>
                                        <UniformGrid ClipToBounds="True"
                                                     Columns="10"
                                                     Grid.Column="2"
                                                     Grid.Row="0">
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphVertLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphVertLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphVertLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphVertLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphVertLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphVertLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphVertLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphVertLine}" />
                                            <Path Style="{StaticResource A_Style_Path_DynoGraphVertLine}" />
                                        </UniformGrid>
                                        <local:FZTextBlock Grid.Column="1"
                                                           Grid.Row="0"
                                                           HorizontalAlignment="Left"
                                                           Margin="6,0,0,0"
                                                           Style="{StaticResource A_Style_FZTextBlock_Dyno_Label}"
                                                           Text="{Binding TextMaxRPM, ElementName=PART_GearGraph}" />
                                        <local:FZTextBlock Grid.Column="1"
                                                           Grid.Row="0"
                                                           HorizontalAlignment="Left"
                                                           Margin="6,0,0,0"
                                                           Style="{StaticResource A_Style_FZTextBlock_Dyno_Label}"
                                                           Text="{Binding TextMidRPM, ElementName=PART_GearGraph}"
                                                           VerticalAlignment="Center" />
                                        <local:FZTextBlock Grid.Column="1"
                                                           Grid.Row="1"
                                                           HorizontalAlignment="Left"
                                                           Margin="6,0,0,0"
                                                           Style="{StaticResource A_Style_FZTextBlock_Dyno_Label}"
                                                           Text="{local:Loc Main.IDS_Zero}"
                                                           VerticalAlignment="Center" />
                                        <local:FZTextBlock Grid.Column="2"
                                                           Grid.Row="1"
                                                           HorizontalAlignment="Center"
                                                           Style="{StaticResource A_Style_FZTextBlock_Dyno_Label}"
                                                           Text="{Binding TextMidSpeed, ElementName=PART_GearGraph}"
                                                           TextAlignment="Center"
                                                           VerticalAlignment="Center" />
                                        <local:FZTextBlock Grid.Column="2"
                                                           Grid.Row="1"
                                                           HorizontalAlignment="Right"
                                                           Style="{StaticResource A_Style_FZTextBlock_Dyno_Label}"
                                                           Text="{Binding TextMaxSpeed, ElementName=PART_GearGraph}"
                                                           VerticalAlignment="Center" />
                                        <local:FZTextBlock Grid.Column="2"
                                                           Grid.Row="2"
                                                           HorizontalAlignment="Center"
                                                           Margin="2,3,0,0"
                                                           Style="{StaticResource A_Style_FZTextBlock_Dyno_Legend}"
                                                           Text="{Binding TextSpeedUnits, ElementName=PART_GearGraph}"
                                                           TextAlignment="Center"
                                                           VerticalAlignment="Center" />
                                        <local:FZTextBlock Grid.Column="0"
                                                           Grid.Row="0"
                                                           HorizontalAlignment="Center"
                                                           Style="{StaticResource A_Style_FZTextBlock_Dyno_Legend}"
                                                           Text="{local:Loc UpgradeCar.IDS_RPM}"
                                                           TextAlignment="Center"
                                                           VerticalAlignment="Center">
                                            <local:FZTextBlock.LayoutTransform>
                                                <TransformGroup>
                                                    <ScaleTransform />
                                                    <SkewTransform />
                                                    <RotateTransform Angle="-90" />
                                                    <TranslateTransform />
                                                </TransformGroup>
                                            </local:FZTextBlock.LayoutTransform>
                                        </local:FZTextBlock>

                                        <local:TransGraphRenderer ClipToBounds="True"
                                                                      Grid.Column="2"
                                                                      Grid.Row="0"
                                                                      Height="134"
                                                                      MapId="gearing"
                                                                      MapProfile="geargraph"
                                                                      Width="332"
                                                                      x:Name="PART_GearGraph"
                                                                      Style="{StaticResource A_Style_TransGraphRenderer_Tuning}" />
                                    </Grid>
                                </Grid>
                            </StackPanel>
                            <!-- Description -->
                            <ContentControl Template="{StaticResource A_ControlTemplate_SidePanel}"
                                                Tag="{local:Loc Assists.IDS_Title_Description}">
                                <DockPanel>
                                    <local:FZMaterial DockPanel.Dock="Top" Style="{StaticResource A_Style_FZMaterial_GlassPanel_NonInteractive}"
                                            Height="72"
                                            Color="{StaticResource H_Color_Primary_Yellow}"
                                            Visibility="{Binding SelectedItem.IsReadOnly, ElementName=PART_OptionList, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}">
                                        <DockPanel Margin="22,0">
                                            <local:FZMaterial DockPanel.Dock="Left" ImageSource="/ForzaUI;component/Textures/Anthem/Icons/Lock.png"
                                                              Color="{StaticResource H_Color_Primary_Black}"
                                                              Width="24" Height="30"/>
                                            <local:FZTextBlock Text="{Binding SelectedItem.UnlockHelp, ElementName=PART_OptionList}" FontFamily="Horizon_C"
                                                    CapHeight="12"
                                                    Margin="21,10,0,10"
                                                    TextWrapping="Wrap" 
                                                    VerticalAlignment="Center"
                                                    Color="{StaticResource H_Color_Primary_Black}"/>
                                        </DockPanel>
                                    </local:FZMaterial>
                                    <FZTextBlock Style="{StaticResource A_Style_FZTextBlock_AutoScroll_TuningDescription}" 
                                        Text="{Binding SelectedItem.Help, ElementName=PART_OptionList}"
                                        MarkupConverter="{StaticResource A_MappingConverter_TuneHelp}"/>
                                </DockPanel>
                            </ContentControl>
                        </DockPanel>
                        <!-- Centre Panel; Tuning options -->
                        <Grid DockPanel.Dock="Top"
                                HorizontalAlignment="Stretch"
                                Margin="4,0"
                                Panel.ZIndex="1"
                                Style="{StaticResource A_Style_FrameworkElement_DefaultTransition}"
                                VerticalAlignment="Top"
                                local:UIPageTransitionManager.TransitionIndex="3">
                            <local:CommonListBox ItemContainerStyle="{StaticResource A_Style_ListBoxItem_List_Tuning}"
                                                     ItemTemplate="{x:Null}"
                                                     ItemsSource="{Binding SelectedItem.Options, ElementName=PART_ChassisTuningGroupList}"
                                                     KeyboardNavigation.DirectionalNavigation="Contained"
                                                     Style="{StaticResource A_Style_ListBox_List_Tuning}"
                                                     Template="{StaticResource A_ControlTemplate_ListBox_Tuning}"
                                                     x:Name="PART_OptionList" 
                                                     Height="752" 
                                                     DefaultSelectedIndex="1"/>
                        </Grid>
                    </DockPanel>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</TuneMenu>
