<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.Scenes.Anthem.A_LiveryMaterialReflectivity"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Margin="0">

    <Page.Resources>
        <ResourceDictionary>
            <System:Double x:Key="H_Slider_Track_Height">9</System:Double>

            <Style x:Key="A_Style_FZTextBlock_Title" 
                   TargetType="local:FZTextBlock">
                <Setter Property="FontFamily" Value="Horizon_A" />
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}" />
                <Setter Property="CapHeight" Value="19" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_Description" 
                   TargetType="local:FZTextBlock">
                <Setter Property="FontFamily" Value="Horizon_D " />
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}" />
                <Setter Property="CapHeight" Value="14 " />
                <Setter Property="TextWrapping" Value="Wrap" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_SliderItemLabel" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonD}" >
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}" />
                <Setter Property="CapHeight" Value="14" />
                <Setter Property="FontFamily" Value="Horizon_A" />
            </Style>

            <Style x:Key="A_Style_MaterialReflectivityThumb" TargetType="{x:Type Thumb}">
                <Setter Property="OverridesDefaultStyle" Value="True"/>
                <Setter Property="Height" Value="18"/>
                <Setter Property="Width" Value="18"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Thumb}">
                            <Grid>
                                <local:FZMaterial x:Name="Border" Color="{StaticResource H_Color_Primary_Pink}">
                                    <FZMaterial.Preset>
                                        <FZMaterialPresetRoundtangle CornerRadius="9"/>
                                    </FZMaterial.Preset>
                                    <local:FZMaterial x:Name="Thumb" Margin="4"  Color="White">
                                        <FZMaterial.Preset>
                                            <FZMaterialPresetRoundtangle CornerRadius="5" />
                                        </FZMaterial.Preset>
                                    </local:FZMaterial>
                                </local:FZMaterial>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_SliderBarMaterial_Base" 
                   TargetType="local:FZMaterial">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Grey_70pc}"/>
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll4px}"/>
            </Style>

            <Style x:Key="A_Style_MaterialReflectivitySlider" TargetType="{x:Type Slider}">
                <Setter Property="SmallChange" Value="0.02"/>
                <Setter Property="LargeChange" Value="0"/>
                <Setter Property="Minimum" Value="-1"/>
                <Setter Property="Maximum" Value="1"/>
                <Setter Property="IsMoveToPointEnabled" Value="True" />
                <Setter Property="Orientation" Value="Horizontal" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Slider}">
                            <Grid x:Name="Grid_Container" RenderTransformOrigin="0.5,0.5">
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}"
                                                  Preset="{StaticResource H_Roundtangle_Outer_3px}"
                                                  Color="{StaticResource H_Color_Primary_Black}"/>
                                <StrokeHighlightControl Style="{StaticResource H_Style_StrokeHighlight_Instant}"
                                            ContentRadius="2"
                                            InnerThickness="4"
                                            OuterThickness="4"/>
                                <StackPanel Margin="20,18,20,12">
                                    <DockPanel LastChildFill="False" Margin="0,0,0,13">
                                        <local:FZTextBlock Text="{local:Loc Livery.IDS_Matte}"
                                                           Style="{StaticResource A_Style_FZTextBlock_SliderItemLabel}"
                                                           DockPanel.Dock="Left" />
                                        <local:FZTextBlock Text="{local:Loc Livery.IDS_Gloss}"
                                                           Style="{StaticResource A_Style_FZTextBlock_SliderItemLabel}"
                                                           DockPanel.Dock="Right" />
                                    </DockPanel>
                                    <Grid>
                                        <local:FZMaterial Style="{StaticResource A_Style_SliderBarMaterial_Base}" Height="9"/>
                                        <UniformGrid Columns="2" x:Name="Bidi_Foreground">
                                            <Track Style="{StaticResource A_Style_Track_OptionsSlider}"
                                                Value="{Binding Value, ElementName=PART_Track}"
                                                Height ="9"
                                                Maximum="0">
                                                <Track.IncreaseRepeatButton>
                                                    <RepeatButton Style="{StaticResource A_Style_RepeatButton_Right}" />
                                                </Track.IncreaseRepeatButton>
                                            </Track>
                                            <Track Style="{StaticResource A_Style_Track_OptionsSlider}"
                                                Value="{Binding Value, ElementName=PART_Track}"
                                                Height ="9"
                                                Minimum="0">
                                                <Track.DecreaseRepeatButton>
                                                    <RepeatButton Style="{StaticResource A_Style_RepeatButton_Right}"  />
                                                </Track.DecreaseRepeatButton>
                                            </Track>
                                        </UniformGrid>
                                        <Track x:Name="PART_Track">
                                            <Track.Thumb>
                                                <Thumb x:Name="Thumb" Style="{StaticResource A_Style_Thumb_OptionsSlider}"/>
                                            </Track.Thumb>
                                        </Track>
                                    </Grid>
                                </StackPanel>
                            
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Page.Resources>

    <Grid>
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="PART_DefaultHelpPanel"
                            Focusable="False"
                    Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>

        <Border x:Name="PART_LayoutRoot"
                Style="{StaticResource A_Style_Border_ScenePadding}"
                Margin="0,-55,0,0">
            <StackPanel VerticalAlignment="Top" 
                        HorizontalAlignment="Left"
                        Width="336">
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}"
                                  Preset="{StaticResource H_Roundtangle_Outer_3px}"
                                  Color="{StaticResource H_Color_Primary_Green}"
                                  Margin="0,0,0,4"
                                  Height="50 ">
                    <local:FZTextBlock Style="{StaticResource H_Style_Text_DescriptionTitle}"
                                       Text="{local:Loc ScreenTitles.IDS_VinylMaterial}"
                                       Margin="14"
                                       HorizontalAlignment="Center" />
                </local:FZMaterial>
                <Grid Height ="80" Margin="0,0,0,4">
                    <local:FZMaterial Preset="{StaticResource H_Roundtangle_Outer_2px}"
                                      Color="{StaticResource H_Color_Glass_Purple_60pc}" />
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Description}" 
                                       Text="{local:Loc Livery.IDS_MaterialReflectivity_Description}"
                                       HorizontalAlignment="Center"
                                       VerticalAlignment="Center"/>
                </Grid>
                <Grid KeyboardNavigation.DirectionalNavigation="Contained" Height="80" >
                    <Slider Value="{Binding MaterialReflectivity, Mode=TwoWay}" Style="{StaticResource A_Style_MaterialReflectivitySlider}"
                        FocusOnPageFocusGained.Self="True" Focusable="True"/>
                </Grid>
            </StackPanel>
        </Border>
    </Grid>
</Page>
