<Page
    xmlns:local="clr-namespace:ForzaUI"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    x:Class="ForzaUI.A_LiveryPosition"
    mc:Ignorable="d"
    x:Name="Page"
    Style="{StaticResource A_Style_Page_Generic}"
    DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <Page.Resources>
        <ResourceDictionary>
            <local:NumUnitConverter x:Key="A_NumUnitConverter_LiveryPosition" FractionDigits="2"/>
            <local:NumUnitConverter x:Key="A_NumUnitConverter_LiveryPosition_Move" MinDigits="3" FractionDigits="2"/>

            <System:Double x:Key="PART_A_Double_MouseMove_Translate_Modifier">0.125</System:Double>
            <System:Double x:Key="PART_A_Double_MouseMove_Scale_Modifier">0.0025</System:Double>
            <System:Double x:Key="PART_A_Double_MouseMove_Rotate_Modifier">0.05</System:Double>
            <System:Double x:Key="PART_A_Double_MouseMove_Shear_Modifier">0.005</System:Double>
            <System:Double x:Key="PART_A_Double_MouseMove_Transparency_Modifier">0.005</System:Double>
            <System:Double x:Key="PART_A_Double_MouseMove_Modifier">1.0</System:Double>
            <System:Double x:Key="PART_A_Double_MouseMove_SlowModifier">0.5</System:Double>
            <System:Double x:Key="PART_A_Double_MouseMove_AccelerationModifier">500</System:Double>
            <System:Double x:Key="PART_A_Double_MouseMove_FastNudgeModifier">20.0</System:Double>

            <System:String x:Key="A_String_IconPath_Scale">/ForzaUI;component/Textures/Anthem/Paintshop/Livery_Position_Scale_Uniform_Icon.png</System:String>
            <System:String x:Key="A_String_IconPath_Rotate">/ForzaUI;component/Textures/Anthem/Paintshop/Livery_Position_Rotate_Icon.png</System:String>
            <System:String x:Key="A_String_IconPath_Shear">/ForzaUI;component/Textures/Anthem/Paintshop/Livery_Position_Skew_Icon.png</System:String>
            <System:String x:Key="A_String_IconPath_Transparency">/ForzaUI;component/Textures/Anthem/Paintshop/Livery_Position_Transparency_Icon.png</System:String>

            <Color x:Key="H_Color_Toggle_Background">#FF8C8C8C</Color>

            <UIStoryboard x:Key="A_Storyboard_ShowButtonPrompt">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
                    <LinearDoubleKeyFrame KeyTime="0:0:0.100" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
            </UIStoryboard>

            <UIStoryboard x:Key="A_Storyboard_HideButtonPrompt">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
                    <LinearDoubleKeyFrame KeyTime="0:0:0.100" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
            </UIStoryboard>
            
            <MappingConverter x:Key="A_TabTypeToVisibilityConverter" Default="Collapsed">
                <MappingConverterEntry Key="{Static LiveryPositionTabType.ScaleXY}" Value="Visible"/>
            </MappingConverter>

            <MappingConverter x:Key="A_Map_ToggleEnabledToAlignment" Default="Right">
                <MappingConverterEntry Key="{StaticResource A_Boolean_False}" Value="Left"/>
            </MappingConverter>

            <MappingConverter x:Key="A_Map_ToggleEnabledToColor" Default="{StaticResource H_Color_Primary_Pink}">
                <MappingConverterEntry Key="{StaticResource A_Boolean_False}" Value="{StaticResource H_Color_Primary_White}"/>
            </MappingConverter>

            <Style x:Key="A_Style_Control_MouseRollover_Outer_All_ToggleButton" BasedOn="{StaticResource A_Style_Control_MouseRollover_Outer_All}"  TargetType="{x:Type Control}">
                <Setter
            Property="Template">
                    <Setter.Value>
                        <ControlTemplate
                    TargetType="Control">
                            <FZMaterial
                        Color="{StaticResource H_Color_Primary_White}">
                                <FZMaterial.Preset>
                                    <FZMaterialPresetRoundtangleStroke
                                CornerRadius="{Binding (DynamicData.Data).MouseRolloverCornerRadius, FallbackValue=1, RelativeSource={RelativeSource TemplatedParent}}"
                                Thickness="3" />
                                </FZMaterial.Preset>
                            </FZMaterial>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            
            <Style x:Key="A_Style_FZTextBlock_LiveryData" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HeaderBlock}">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}" />
                <Setter Property="Margin" Value="0" />
                <Setter Property="CapHeight" Value="18" />
                <Setter Property="Opacity" Value="1" />
            </Style>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_ImageAndDataBox" TargetType="ContentControl">
                <DockPanel MinWidth="186" MaxWidth="300" MinHeight="48">
                    <local:FZMaterial Preset="{StaticResource H_Roundtangle_LeftOnly_1px}"
                                      DockPanel.Dock="Left" 
                                      Width="48" 
                                      Height="48"
                                      Color="{StaticResource H_Color_Primary_White}">
                        <local:FZMaterial Height="30" Width="30" ImageSource="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"
                                          Color="{StaticResource H_Color_Primary_Black}"/>
                    </local:FZMaterial>
                    <Grid>
                        <local:FZMaterial Color="{StaticResource H_Color_Primary_Black}"
                                          Height="48"
                                          Preset="{StaticResource H_GlassRoundtangle_RightOnly_2px}"
                                          Color="{StaticResource H_Color_Glass_Purple_40pc}"/>
                        <Viewbox HorizontalAlignment="Left" Margin="10,0,0,0"  StretchDirection="DownOnly">
                            <local:FZTextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource A_Style_FZTextBlock_LiveryData}"  />
                        </Viewbox>
                    </Grid>
                </DockPanel>
            </ControlTemplate>

            <Thickness x:Key="A_Thickness_PositionControlSpacing">0,0,8,0</Thickness>

            <Style x:Key="A_Style_Control_Move" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Control}">
                            <StackPanel Orientation="Horizontal">
                                <ContentControl Tag="/ForzaUI;component/Textures/Anthem/Paintshop/Livery_Position_Position_X_Icon.png" 
                                                Content="{Binding TranslationX, Converter={StaticResource A_NumUnitConverter_LiveryPosition_Move}, ElementName=Page}" 
                                                Template="{StaticResource A_ControlTemplate_ContentControl_ImageAndDataBox}" 
                                                Margin="{StaticResource A_Thickness_PositionControlSpacing}" />

                                <ContentControl Tag="/ForzaUI;component/Textures/Anthem/Paintshop/Livery_Position_Position_Y_Icon.png" 
                                                Content="{Binding TranslationY, Converter={StaticResource A_NumUnitConverter_LiveryPosition_Move}, ElementName=Page}" 
                                                Template="{StaticResource A_ControlTemplate_ContentControl_ImageAndDataBox}" />
                            </StackPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_Control_Scale" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Control}">
                            <Grid>
                                <StackPanel Orientation="Horizontal">
                                    <ContentControl Tag="/ForzaUI;component/Textures/Anthem/Paintshop/Livery_Position_Scale_X_Icon.png" 
                                                    Content="{Binding ScaleX, Converter={StaticResource A_NumUnitConverter_LiveryPosition}, ElementName=Page}" 
                                                    Template="{StaticResource A_ControlTemplate_ContentControl_ImageAndDataBox}" 
                                                    Margin="{StaticResource A_Thickness_PositionControlSpacing}"/>

                                    <ContentControl Tag="/ForzaUI;component/Textures/Anthem/Paintshop/Livery_Position_Scale_Y_Icon.png" 
                                                    Content="{Binding ScaleY, Converter={StaticResource A_NumUnitConverter_LiveryPosition}, ElementName=Page}" 
                                                    Template="{StaticResource A_ControlTemplate_ContentControl_ImageAndDataBox}"/>
                                </StackPanel>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            
            <Style x:Key="A_Style_Hideable_Button_Prompt" TargetType="{x:Type Grid}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding AdvancedCameraEnabled}" Value="False">
                        <DataTrigger.EnterActions>
                            <BeginStoryboard Storyboard="{StaticResource A_Storyboard_ShowButtonPrompt}"/>
                        </DataTrigger.EnterActions>
                        <DataTrigger.ExitActions>
                            <BeginStoryboard Storyboard="{StaticResource A_Storyboard_HideButtonPrompt}"/>
                        </DataTrigger.ExitActions>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_Control_ScaleUniform" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Control}">
                            <Grid>
                                <ContentControl Tag="{StaticResource A_String_IconPath_Scale}" 
                                                Content="{Binding ScaleX, Converter={StaticResource A_NumUnitConverter_LiveryPosition}, ElementName=Page}" 
                                                Template="{StaticResource A_ControlTemplate_ContentControl_ImageAndDataBox}"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_Control_Transparency" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Control}">
                            <ContentControl Tag="{StaticResource A_String_IconPath_Transparency}" 
                                            Content="{Binding Transparency, Converter={StaticResource A_NumUnitConverter_LiveryPosition}, ElementName=Page}" 
                                            Template="{StaticResource A_ControlTemplate_ContentControl_ImageAndDataBox}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_Control_Rotate" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Control}">
                            <ContentControl Tag="{StaticResource A_String_IconPath_Rotate}" 
                                            Content="{Binding Rotation, Converter={StaticResource A_NumUnitConverter_LiveryPosition}, ElementName=Page}" 
                                            Template="{StaticResource A_ControlTemplate_ContentControl_ImageAndDataBox}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_Control_Shear" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Control}">
                            <ContentControl Tag="{StaticResource A_String_IconPath_Shear}" 
                                            Content="{Binding Shear, Converter={StaticResource A_NumUnitConverter_LiveryPosition}, ElementName=Page}" 
                                            Template="{StaticResource A_ControlTemplate_ContentControl_ImageAndDataBox}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_TabBar_LiveryPosition" BasedOn="{StaticResource H_Style_TabBar_SquareIcons}" TargetType="ItemsSelector">
                <Setter Property="Height" Value="48" />
                <Setter Property="DynamicData.Data">
                    <Setter.Value>
                        <DynamicDataSource>
                            <DynamicDataItem
                                Name="TabHeight"
                                DataType="Double"
                                Value="48" />
                            <DynamicDataItem
                                Name="NextOrPreviousWidth"
                                DataType="Double"
                                Value="66" />
                            <DynamicDataItem
                                Name="NextOrPreviousHeight"
                                DataType="Double"
                                Value="48" />
                            <DynamicDataItem
                                Name="ButtonWidth"
                                DataType="Double"
                                Value="48" />
                        </DynamicDataSource>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_Control_PositionInfo" TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Control}">
                            <Grid>
                                <Control x:Name="Control_Move" Style="{StaticResource A_Style_Control_Move}" Focusable="False"/>
                                <Control x:Name="Control_Size" Style="{StaticResource A_Style_Control_Scale}" Focusable="False"/>
                                <Control x:Name="Control_SizeUniform" Style="{StaticResource A_Style_Control_ScaleUniform}" Focusable="False"/>
                                <Control x:Name="Control_Spin" Style="{StaticResource A_Style_Control_Rotate}" Focusable="False"/>
                                <Control x:Name="Control_Skew" Style="{StaticResource A_Style_Control_Shear}" Focusable="False"/>
                                <Control x:Name="Control_Transparency" Style="{StaticResource A_Style_Control_Transparency}" Focusable="False"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property="Tag">
                                    <Trigger.Value>
                                        <local:LiveryPositionTabType>Translate</local:LiveryPositionTabType>
                                    </Trigger.Value>
                                    <Setter TargetName="Control_Move" Property="Visibility" Value="Visible"/>
                                    <Setter TargetName="Control_Size" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_SizeUniform" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Spin" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Skew" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Transparency" Property="Visibility" Value="Collapsed"/>
                                </Trigger>
                                <Trigger Property="Tag">
                                    <Trigger.Value>
                                        <local:LiveryPositionTabType>ScaleXY</local:LiveryPositionTabType>
                                    </Trigger.Value>
                                    <Setter TargetName="Control_Move" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Size" Property="Visibility" Value="Visible"/>
                                    <Setter TargetName="Control_SizeUniform" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Spin" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Skew" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Transparency" Property="Visibility" Value="Collapsed"/>
                                </Trigger>
                                <Trigger Property="Tag">
                                    <Trigger.Value>
                                        <local:LiveryPositionTabType>ScaleUniform</local:LiveryPositionTabType>
                                    </Trigger.Value>
                                    <Setter TargetName="Control_Move" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Size" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_SizeUniform" Property="Visibility" Value="Visible"/>
                                    <Setter TargetName="Control_Spin" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Skew" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Transparency" Property="Visibility" Value="Collapsed"/>
                                </Trigger>
                                <Trigger Property="Tag">
                                    <Trigger.Value>
                                        <local:LiveryPositionTabType>Shear</local:LiveryPositionTabType>
                                    </Trigger.Value>
                                    <Setter TargetName="Control_Move" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Size" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_SizeUniform" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Spin" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Skew" Property="Visibility" Value="Visible"/>
                                    <Setter TargetName="Control_Transparency" Property="Visibility" Value="Collapsed"/>
                                </Trigger>
                                <Trigger Property="Tag">
                                    <Trigger.Value>
                                        <local:LiveryPositionTabType>Rotate</local:LiveryPositionTabType>
                                    </Trigger.Value>
                                    <Setter TargetName="Control_Move" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Size" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_SizeUniform" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Spin" Property="Visibility" Value="Visible"/>
                                    <Setter TargetName="Control_Skew" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Transparency" Property="Visibility" Value="Collapsed"/>
                                </Trigger>
                                <Trigger Property="Tag">
                                    <Trigger.Value>
                                        <local:LiveryPositionTabType>Transparency</local:LiveryPositionTabType>
                                    </Trigger.Value>
                                    <Setter TargetName="Control_Move" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Size" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_SizeUniform" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Spin" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Skew" Property="Visibility" Value="Collapsed"/>
                                    <Setter TargetName="Control_Transparency" Property="Visibility" Value="Visible"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Page.Resources>

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

    <Grid>
        <local:FZMaterialGlassCapture />
        <PageInputHandler x:Name="details_toggle_uniform_scale" Command="{Binding ToggleUniformScaleCommand, RelativeSource={RelativeSource AncestorType=Page}}" Button="Back" />
        <local:RoutedEventCommand x:Name="ToggleUniformScaleRoutedEventCommand"
                                  RoutedEvent="UIElement.MouseLeftButtonDown"
                                  Command="{Binding ToggleUniformScaleCommand, RelativeSource={RelativeSource AncestorType=Page}}" />
        <local:RoutedEventCommand x:Name="StartMouseDragRoutedEventCommand"
                                  RoutedEvent="UIElement.MouseLeftButtonDown"
                                  Command="{Binding StartMouseDragCommand, RelativeSource={RelativeSource AncestorType=Page}}" />

        <local:FZMaterial x:Name="MouseMoveHelper"
                          Color="#00000000"
                          local:RoutedEventCommand.Action="{Binding ElementName=StartMouseDragRoutedEventCommand}" />

        <!-- Bars -->
        <ContentControl Style="{StaticResource A_Style_ButtonBar}"
                        x:Name="BottomBar">
            <local:ControllerButtonPanel x:Name="PART_HelpPanel"
                                         Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <local:ControllerButtonControl Button="A"
                                               Description="{local:Loc HelpButtons.IDS_OK}" />
                <local:ControllerButtonControl Button="B"
                                               Description="{local:Loc HelpButtons.IDS_Back}" />
                <local:ControllerButtonControl Button="X"
                                               Description="{local:Loc Livery.IDS_Color}" 
                                               Visibility="{Binding CanSelectColor, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                <local:ControllerButtonControl Button="Y"
                                               Description="{local:Loc Livery.IDS_Stamp}" />
                <local:ControllerButtonControl Button="RTrigger"
                                               Description="{local:Loc Livery.IDS_FlipLayer}" 
                                               Visibility="{Binding CanFlip, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
            </local:ControllerButtonPanel>
        </ContentControl>
        <Border x:Name="PART_LayoutRoot" Style="{StaticResource A_Style_Border_ScenePadding_Opus}" Padding="72,48,72,0">
            <Grid>
                <StackPanel Orientation="Vertical" VerticalAlignment="Top" >
                    <ContentControl
                           Grid.Row="0"
                           Content="{Binding SelectedItem.Title, ElementName=PART_ItemsSelector_PositionType}"
                           Style="{StaticResource A_Style_ContentControl_Header}"
                           HorizontalAlignment="Left"
                           Width="{Binding ActualWidth, ElementName=PART_ItemsSelector_PositionType}"/>

                    <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}" Focusable="False" HorizontalAlignment="Left" Margin="0,0,0,6">
                        <FZButtonsSelector
                       x:Name="PART_ItemsSelector_PositionType"
                       MaxWidth="1250"
                       Style="{StaticResource A_Style_TabBar_LiveryPosition}"
                       ItemsSource="{Binding ModeItems}"/>
                    </Decorator>

                    <StackPanel Orientation="Horizontal" Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_2}" Margin="0,0,0,10">
                        <Control Style="{StaticResource A_Style_Control_PositionInfo}" Tag="{Binding SelectedItem.TabType, ElementName=PART_ItemsSelector_PositionType}" Focusable="False"/>
                    </StackPanel>

                    <Grid Name="Scale_Uniform_Button_Prompt"
                              Style ="{StaticResource A_Style_Hideable_Button_Prompt}"
                              HorizontalAlignment="Left" 
                              VerticalAlignment="Bottom" 
                              MinWidth="250" 
                              Height="48"
                              Visibility="{Binding SelectedItem.TabType, Converter={StaticResource A_TabTypeToVisibilityConverter}, ElementName=PART_ItemsSelector_PositionType}"
                              local:RoutedEventCommand.Action="{Binding ElementName=ToggleUniformScaleRoutedEventCommand}">
                        <FZMaterial 
                                 Color="{StaticResource H_Color_Glass_Purple_40pc}"
                                 Preset="{StaticResource H_GlassRoundtangle_1px}"/>
                        <StackPanel Margin="10,0,10,0" Orientation="Horizontal">
                            <ControllerButtonControl
                                     Button="{Binding Button, ElementName=details_toggle_uniform_scale}"
                                     Description="{local:Loc Livery.IDS_ScaleUniform}"
                                     HideBackground="True"/>
                            <Decorator Width="22" Visibility="{Binding IsControllerActiveInput, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}, RelativeSource={RelativeSource AncestorType=Page}}"/>
                            <Grid Margin="-20,0,0,0">
                                <FZMaterial
                                         Height="28"
                                         Width="41"
                                         Color="{Binding ScaleLockedToUniform, Converter={StaticResource A_Map_ToggleEnabledToColor}}">
                                    <FZMaterial.Preset>
                                        <FZMaterialPresetRoundtangleStroke CornerRadius="14" Thickness="2.5" />
                                    </FZMaterial.Preset>
                                </FZMaterial>
                                <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                    <FZMaterial
                                             Height="17"
                                             Width="30"
                                             Color="{StaticResource H_Color_Toggle_Background}">
                                        <FZMaterial.Preset>
                                            <FZMaterialPresetRoundtangle CornerRadius="8" />
                                        </FZMaterial.Preset>
                                    </FZMaterial>
                                    <FZMaterial
                                             Height="18"
                                             Width="18"
                                             Color="{Binding ScaleLockedToUniform, Converter={StaticResource A_Map_ToggleEnabledToColor}}"
                                             HorizontalAlignment="{Binding ScaleLockedToUniform, Converter={StaticResource A_Map_ToggleEnabledToAlignment},RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}">
                                        <FZMaterial.Preset>
                                            <FZMaterialPresetRoundtangle CornerRadius="8" />
                                        </FZMaterial.Preset>
                                    </FZMaterial>
                                </Grid>
                            </Grid>

                        </StackPanel>

                        <FZMaterial Color="#0fff" IsHitTestVisible="True" />

                        <Control Style="{StaticResource A_Style_Control_MouseRollover_Outer_All_ToggleButton}"
                                 Visibility="{Binding IsMouseOver,  RelativeSource={RelativeSource FindAncestor, AncestorType=Grid}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
                    </Grid>
                </StackPanel>
                <Decorator Visibility="{Binding HasCamera, Converter={StaticResource A_FZBooleanToVisibilityConverter}, RelativeSource={RelativeSource AncestorType=Page}}">
                    <StackPanel Margin="0,1,0,0" Name="Advanced_Camera_Button_Prompt_Camera" Visibility="{Binding IsControllerActiveInput, Converter={StaticResource A_FZBooleanToVisibilityConverter}, RelativeSource={RelativeSource AncestorType=Page}}">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"  Visibility="{Binding HasCamera, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                            <FZMaterial Color="{StaticResource H_Color_Primary_White}" Height="48" Width="48">
                                <FZMaterial Color="{StaticResource H_Color_Primary_Black}"  Height="48" Width="48" ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/advanced_camera.png"/>
                            </FZMaterial>
                            <Grid 
                    Name="Advanced_Camera_Button_Prompt"
                    MinWidth="300" 
                    Height="48">
                                <FZMaterial 
                    Color="{StaticResource H_Color_Glass_Purple_40pc}"
                    Preset="{StaticResource H_GlassRoundtangle_1px}"/>
                                <DockPanel Margin="10,0,10,0">
                                    <ControllerButtonControl
                            Button="LTrigger"
                            Description="{local:Loc HelpButtons.IDS_AdvancedCamera}"
                            HideBackground="True"/>
                                    <Grid>
                                        <FZMaterial
                                Height="30"
                                Width="43"
                                Color="{Binding AdvancedCameraEnabled, Converter={StaticResource A_Map_ToggleEnabledToColor}}">
                                            <FZMaterial.Preset>
                                                <FZMaterialPresetRoundtangleStroke CornerRadius="14" Thickness="3.5" />
                                            </FZMaterial.Preset>
                                        </FZMaterial>
                                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                            <FZMaterial
                                    Height="17"
                                    Width="30"
                                    Color="{StaticResource H_Color_Toggle_Background}">
                                                <FZMaterial.Preset>
                                                    <FZMaterialPresetRoundtangle CornerRadius="8" />
                                                </FZMaterial.Preset>
                                            </FZMaterial>
                                            <FZMaterial
                                   Height="18"
                                   Width="18"
                                   Color="{Binding AdvancedCameraEnabled, Converter={StaticResource A_Map_ToggleEnabledToColor}}"
                                   HorizontalAlignment="{Binding AdvancedCameraEnabled, Converter={StaticResource A_Map_ToggleEnabledToAlignment},RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}">
                                                <FZMaterial.Preset>
                                                    <FZMaterialPresetRoundtangle CornerRadius="8" />
                                                </FZMaterial.Preset>
                                            </FZMaterial>
                                        </Grid>
                                    </Grid>
                                </DockPanel>
                                <FZMaterial Color="#0fff" IsHitTestVisible="True" />
                            </Grid>
                        </StackPanel>
                        <FZMaterial Color="{StaticResource H_Color_Glass_Purple_20pc}" 
                        Preset="{StaticResource H_GlassRoundtangle_1px}" 
                        Height="48" 
                        Width="219" 
                        HorizontalAlignment="Right"
                        Margin="0,3,0,0"
                        Visibility="{Binding AdvancedCameraEnabled, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                            <StackPanel Orientation="Horizontal">
                                <ControllerButtonControl
                       Margin="10,0,0,0"
                       Button="LThumb_UpDown"
                       Description="{local:Loc HelpButtons.IDS_AdvancedCameraZoom}"
                       HorizontalAlignment="Left"
                       HideBackground="True"/>
                                <ControllerButtonControl
                       Button="RThumb" 
                       HorizontalAlignment="Right"
                       Description="{local:Loc HelpButtons.IDS_AdvancedCameraPan}"
                       HideBackground="True"/>
                            </StackPanel>
                        </FZMaterial>
                    </StackPanel>
                </Decorator>
            </Grid>
        </Border>
    </Grid>
</Page>
