<?xml version="1.0" encoding="utf-8"?>
<Application x:Class="SalesDashboard.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:sys="clr-namespace:System;assembly=mscorlib">
    <Application.Resources>

        <!--
        
        Simplified ScrollBar template (applies to whole app).
        
        -->
        <Style TargetType="ScrollBar">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollBar">
                        <Grid x:Name="Root" Background="{TemplateBinding Background}">
                            <Grid.Resources>

                                <!-- RepeatButton Templates -->
                                <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root" Background="Transparent" />
                                </ControlTemplate>

                                <!-- Horizontal Inc/Dec Templates -->
                                <ControlTemplate x:Key="HorizontalIncrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <Path Stretch="Uniform" Height="8" Width="4" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Fill="{TemplateBinding Foreground}" />
                                        <Rectangle x:Name="DisabledElement" Opacity="0" RadiusX="2" RadiusY="2" Fill="#FFFFFFFF" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <Path Stretch="Uniform" Height="8" Width="4" Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " Fill="{TemplateBinding Foreground}" />
                                        <Rectangle x:Name="DisabledElement" Opacity="0" RadiusX="2" RadiusY="2" Fill="#FFFFFFFF" />
                                    </Grid>
                                </ControlTemplate>

                                <!-- Vertical Inc/Dec Templates -->
                                <ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <Path Stretch="Uniform" Height="4" Width="8" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " Fill="{TemplateBinding Foreground}" />
                                        <Rectangle x:Name="DisabledElement" Opacity="0" RadiusX="2" RadiusY="2" Fill="#FFFFFFFF" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <Path Stretch="Uniform" Height="4" Width="8" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z " Fill="{TemplateBinding Foreground}" />
                                        <Rectangle x:Name="DisabledElement" Opacity="0" RadiusX="2" RadiusY="2" Fill="#FFFFFFFF" />
                                    </Grid>
                                </ControlTemplate>

                                <!-- Thumb Templates -->
                                <ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
                                    <Grid x:Name="ThumbVisual" Margin="4,0,4,0">
                                        <Rectangle x:Name="Background" RadiusX="4" RadiusY="4" Fill="{TemplateBinding Foreground}" Opacity=".7" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalThumbTemplate" TargetType="Thumb">
                                    <Grid x:Name="ThumbVisual" Margin="0,4,0,4">
                                        <Rectangle x:Name="Background" RadiusX="4" RadiusY="4" Fill="{TemplateBinding Foreground}" Opacity=".7" />
                                    </Grid>
                                </ControlTemplate>
                            </Grid.Resources>

                            <!-- Horizontal Template -->
                            <Grid x:Name="HorizontalRoot" Background="#10000000">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <!-- Repeat Buttons + Thumb -->
                                <RepeatButton x:Name="HorizontalSmallDecrease" Foreground="{TemplateBinding Foreground}" Grid.Column="0" Width="16" IsTabStop="False" Interval="50" Template="{StaticResource HorizontalDecrementTemplate}" Margin="1" />
                                <RepeatButton x:Name="HorizontalLargeDecrease" Grid.Column="1" Width="0" Template="{StaticResource RepeatButtonTemplate}" Interval="50" IsTabStop="False" />
                                <Thumb x:Name="HorizontalThumb" Background="{TemplateBinding Background}" MinWidth="18" Width="18" Grid.Column="2" Template="{StaticResource HorizontalThumbTemplate}" />
                                <RepeatButton x:Name="HorizontalLargeIncrease" Grid.Column="3" Template="{StaticResource RepeatButtonTemplate}" Interval="50" IsTabStop="False" />
                                <RepeatButton x:Name="HorizontalSmallIncrease" Foreground="{TemplateBinding Foreground}" Grid.Column="4" Width="16" IsTabStop="False" Interval="50" Template="{StaticResource HorizontalIncrementTemplate}" Margin="1" />
                            </Grid>

                            <!-- Vertical Template -->
                            <Grid x:Name="VerticalRoot" Visibility="Collapsed" Background="#10000000">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>

                                <!-- Repeat Buttons + Thumb -->
                                <RepeatButton x:Name="VerticalSmallDecrease" Foreground="{TemplateBinding Foreground}" Grid.Row="0" Height="16" IsTabStop="False" Interval="50" Template="{StaticResource VerticalDecrementTemplate}" Margin="1" />
                                <RepeatButton x:Name="VerticalLargeDecrease" Grid.Row="1" Height="0" Template="{StaticResource RepeatButtonTemplate}" Interval="50" IsTabStop="False" />
                                <Thumb x:Name="VerticalThumb" Background="{TemplateBinding Background}" MinHeight="18" Height="18" Grid.Row="2" Template="{StaticResource VerticalThumbTemplate}" />
                                <RepeatButton x:Name="VerticalLargeIncrease" Grid.Row="3" Template="{StaticResource RepeatButtonTemplate}" Interval="50" IsTabStop="False" />
                                <RepeatButton x:Name="VerticalSmallIncrease" Foreground="{TemplateBinding Foreground}" Grid.Row="4" Height="16" IsTabStop="False" Interval="50" Template="{StaticResource VerticalIncrementTemplate}" Margin="1" />
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <sys:String x:Key="Title">Sales Dashboard</sys:String>
        <sys:String x:Key="Subtitle">This project illustrates how you can use the Esri map and C1 controls to build a sales dashboard application.
        The data used in this project is stored on ArcGIS Online through REST based services.</sys:String>
        <sys:String x:Key="Info">Powered by Esri and C1</sys:String>
        <sys:String x:Key="MapStyleMenuTitle">Basemap</sys:String>
        <SolidColorBrush x:Key="BaseColor" Color="#FF333333" />
        <Style x:Name="titleTextStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="White" />
            <Setter Property="VerticalAlignment" Value="Bottom" />
            <Setter Property="HorizontalAlignment" Value="Right" />
            <Setter Property="Margin" Value="5,5,0,0" />
            <Setter Property="FontSize" Value="32" />
            <Setter Property="FontWeight" Value="Bold" />
        </Style>
        

        <LinearGradientBrush x:Name="ReflectionGradient" StartPoint="0.5,0" EndPoint="0.5,1">
            <LinearGradientBrush.GradientStops>
                <GradientStop Color="#70FFFFFF" Offset="0" />
                <GradientStop Color="#30FFFFFF" Offset="0.5" />
                <GradientStop Color="#00FFFFFF" Offset="0.5" />
                <GradientStop Color="#30FFFFFF" Offset="1" />
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <Style x:Name="border" TargetType="Border">
            <Setter Property="BorderBrush" Value="Gray" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Background" Value="{StaticResource BaseColor}" />
        </Style>

        <Style x:Name="menuBorder" TargetType="Border" BasedOn="{StaticResource border}">
            <Setter Property="Margin" Value="5,0,0,0" />
            <Setter Property="Padding" Value="2" />
        </Style>

        <Style TargetType="RadioButton">
            <Setter Property="Foreground" Value="#eeeeee" />
            <Setter Property="Background" Value="{StaticResource BaseColor}" />
            <Setter Property="Margin" Value="0" />
            <Setter Property="Padding" Value="5" />
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Height" Value="30" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="RadioButton">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.25" Storyboard.TargetName="HoverGlow" Storyboard.TargetProperty="Opacity" To=".25" />
                                            <DoubleAnimation Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="Opacity" Duration="0" To="1" />
                                            <DoubleAnimation Storyboard.TargetName="BoxMiddleBackground" Storyboard.TargetProperty="Opacity" Duration="0" To="1" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Duration="0" To="#7FFFFFFF" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Duration="0" To="#CCFFFFFF" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Duration="0" To="#F2FFFFFF" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="BackgroundOverlay" Storyboard.TargetProperty="Opacity" Duration="0" To="1" />
                                            <DoubleAnimation Storyboard.TargetName="BoxMiddleBackground" Storyboard.TargetProperty="Opacity" Duration="0" To="1" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Duration="0" To="#6BFFFFFF" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Duration="0" To="#C6FFFFFF" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Duration="0" To="#EAFFFFFF" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Duration="0" To="#F4FFFFFF" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Stroke).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Duration="0" To="#FF6DBDD1" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Stroke).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Duration="0" To="#FF6DBDD1" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Stroke).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Duration="0" To="#FF6DBDD1" />
                                            <ColorAnimation Storyboard.TargetName="BoxMiddle" Storyboard.TargetProperty="(Shape.Stroke).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Duration="0" To="#FF6DBDD1" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0" To=".55" />
                                            <DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0" To="0.55" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="CheckIcon" Storyboard.TargetProperty="(UIElement.Opacity)" Duration="0" To="1" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="ContentFocusVisualElement" Storyboard.TargetProperty="Opacity" Duration="0" To="1" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <!--Main color of the button-->
                            <Rectangle RadiusY="3" RadiusX="3" Grid.ColumnSpan="2" Fill="{TemplateBinding Background}" />
                            <Rectangle x:Name="HoverGlow" RadiusY="3" RadiusX="3" Grid.ColumnSpan="2" Fill="White" Opacity="0" />
                            <Rectangle x:Name="BackgroundGradient" RadiusY="3" RadiusX="3" Grid.ColumnSpan="2" Opacity=".5" Stroke="{TemplateBinding Background}" StrokeThickness=".75" StrokeLineJoin="Round" Fill="{StaticResource ReflectionGradient}">
                            </Rectangle>
                            <StackPanel Orientation="Horizontal">
                                <Grid HorizontalAlignment="Left" VerticalAlignment="Center" Margin="{TemplateBinding Padding}">
                                    <Ellipse x:Name="Background" Width="14" Height="14" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Fill="#FFFFFFFF" Margin="1" />
                                    <Ellipse x:Name="BackgroundOverlay" Fill="#FFC4DBEE" Opacity="0" Width="14" Height="14" StrokeThickness="1" Margin="1" Stroke="#00000000" />
                                    <Ellipse x:Name="BoxMiddleBackground" Width="10" Height="10" Fill="{TemplateBinding Background}" Stroke="#00000000" StrokeThickness="1" />
                                    <Ellipse x:Name="BoxMiddle" Width="10" Height="10" StrokeThickness="1">
                                        <Ellipse.Stroke>
                                            <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                <GradientStop Color="#FFFFFFFF" Offset="1" />
                                                <GradientStop Color="#FFFFFFFF" Offset="0" />
                                                <GradientStop Color="#FFFFFFFF" Offset="0.375" />
                                                <GradientStop Color="#FFFFFFFF" Offset="0.375" />
                                            </LinearGradientBrush>
                                        </Ellipse.Stroke>
                                        <Ellipse.Fill>
                                            <LinearGradientBrush StartPoint="0.62,0.15" EndPoint="0.64,0.88">
                                                <GradientStop Color="#FFFFFFFF" Offset="0.013" />
                                                <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                <GradientStop Color="#EAFFFFFF" Offset="0.603" />
                                                <GradientStop Color="#D8FFFFFF" Offset="1" />
                                            </LinearGradientBrush>
                                        </Ellipse.Fill>
                                    </Ellipse>
                                    <Ellipse x:Name="BoxMiddleLine" Width="10" Height="10" Stroke="#FF333333" StrokeThickness="1" Opacity=".2" />
                                    <Ellipse x:Name="CheckIcon" Fill="#FF333333" Width="4" Height="4" Opacity="0" />
                                    <Ellipse x:Name="DisabledVisualElement" Width="14" Height="14" Opacity="0" Fill="#FFFFFFFF" />
                                    <Ellipse x:Name="ContentFocusVisualElement" Stroke="#FF6DBDD1" StrokeThickness="1" Opacity="0" IsHitTestVisible="false" Width="16" Height="16" />
                                </Grid>

                                <ContentPresenter Grid.Column="1" x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" />
                            </StackPanel>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="Button">
            <Setter Property="Background" Value="{StaticResource BaseColor}" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Padding" Value="10,5,10,5" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid x:Name="RootElement" Cursor="{TemplateBinding Cursor}">

                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />

                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.25" Storyboard.TargetName="HoverGlow" Storyboard.TargetProperty="Opacity" To="0.25" />
                                        </Storyboard>
                                    </VisualState>

                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Opacity" To="0.75" />
                                            <DoubleAnimation Duration="0:0:0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="StrokeThickness" To="1.5" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="Opacity" To=".55" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>

                            <!--Main color of the button-->
                            <Rectangle x:Name="Background" RadiusY="3" RadiusX="3" Fill="{TemplateBinding Background}" />

                            <Rectangle x:Name="HoverGlow" Opacity="0" Fill="White" RadiusY="3" RadiusX="3" />
                            <!--Reflection effect-->
                            <Rectangle x:Name="BackgroundGradient" RadiusY="3" RadiusX="3" Opacity=".5" StrokeThickness=".75" StrokeLineJoin="Round" Fill="{StaticResource ReflectionGradient}">
                                <Rectangle.Stroke>
                                    <SolidColorBrush x:Name="BorderBrush" Color="#FF333333" />
                                </Rectangle.Stroke>
                            </Rectangle>

                            <Rectangle x:Name="FocusVisualElement" Stretch="Fill" StrokeThickness="1.0" Stroke="#FFFFFFFF" StrokeDashCap="Square" StrokeDashArray="1 2" Margin="3" Visibility="Collapsed" RadiusX="3" RadiusY="3" />

                            <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" />

                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--Navigation Style-->
        <Style TargetType="esri:Navigation">
            <Setter Property="Background" Value="#ee333333" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="esri:Navigation">
                        <Grid x:Name="LayoutRoot">
                            <Grid.Resources>
                                <SolidColorBrush x:Key="FillColor" Color="#FF949494" />
                                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" x:Name="NavGradient">
                                    <GradientStop Offset="0" Color="#eec7c8c9" />
                                    <GradientStop Offset="0.25" Color="#ee878787" />
                                    <GradientStop Offset="0.75" Color="#ee757575" />
                                </LinearGradientBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Name="NavBorderGradient">
                                    <GradientStop Color="#66FFFFFF" />
                                    <GradientStop Color="#661d1d1d" Offset="1" />
                                </LinearGradientBrush>
                                <LinearGradientBrush x:Key="DarkTwoGradient" StartPoint="0.5,0" EndPoint="0.5,1">
                                    <GradientStop Color="#D07E7C7C" Offset="0" />
                                    <GradientStop Color="#902D2D2D" Offset="0.498" />
                                    <GradientStop Color="#605C5C5C" Offset="0.484" />
                                    <GradientStop Color="#90201F1F" Offset="1" />
                                </LinearGradientBrush>
                            </Grid.Resources>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RenderTransform>
                                <ScaleTransform CenterX="0" CenterY="0" ScaleX="0.65" ScaleY="0.65" />
                            </Grid.RenderTransform>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)" To="0.2" Duration="0:0:0.1" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)" To="1" Duration="0:0:0.1" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Rectangle Fill="{TemplateBinding Background}" Stroke="#66FFFFFF" Margin="0" Grid.ColumnSpan="2" RadiusX="10" RadiusY="10" />


                            <Grid x:Name="ZoomGrid" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,10,0,10">
                                <Rectangle Margin="0" RadiusX="5" RadiusY="5" Fill="{StaticResource DarkTwoGradient}" Stroke="#66FFFFFF" />
                                <StackPanel x:Name="ZoomStack" Orientation="Vertical">
                                    <Button x:Name="ZoomInButton" Height="25" FontSize="12" Foreground="#FFFFFFFF" FontWeight="Bold" Width="25" Padding="-5" ToolTipService.ToolTip="Zoom In" Margin="2,2,2,0" Content="+">
                                    </Button>
                                    <Slider x:Name="ZoomSlider" Orientation="Vertical" Height="80" Minimum="0" SmallChange="1" LargeChange="1" ToolTipService.ToolTip="Move bar up to zoom in, down to zoom out" />
                                    <Button x:Name="ZoomOutButton" Height="25" FontSize="12" Foreground="#FFFFFFFF" FontWeight="Bold" Width="25" Padding="-5" ToolTipService.ToolTip="Zoom Out" Margin="2,0,2,2" Content="-">
                                    </Button>

                                </StackPanel>
                            </Grid>
                            <Ellipse StrokeThickness="2" Width="120" Height="120" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Stroke="#66FFFFFF" Fill="{StaticResource DarkTwoGradient}" />

                            <Grid x:Name="Navigator" RenderTransformOrigin="0.5,0.5" Margin="10" Width="120" Height="120" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
                                <Grid.RenderTransform>
                                    <RotateTransform x:Name="TransformRotate" Angle="0" />
                                </Grid.RenderTransform>
                                <Ellipse x:Name="RotateRing" StrokeThickness="2" Width="120" Height="120" HorizontalAlignment="Center" VerticalAlignment="Center" Stroke="#66FFFFFF" Fill="#00FFFFFF" />
                                <Ellipse x:Name="innerRing" Fill="Gray" Stroke="Black" StrokeThickness="1" Width="80" Height="80" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                <Grid x:Name="PanLeft" Width="20" Height="20" Background="#00FFFFFF" HorizontalAlignment="Left" VerticalAlignment="Center" ToolTipService.ToolTip="Click to move west" Cursor="Hand">
                                    <TextBlock Text="W" TextAlignment="Center" VerticalAlignment="Center" FontSize="12" Foreground="#FFFFFFFF" FontWeight="Bold" />
                                </Grid>
                                <Grid x:Name="PanRight" Width="20" Height="20" Background="#00FFFFFF" HorizontalAlignment="Right" VerticalAlignment="Center" ToolTipService.ToolTip="Click to move east" Cursor="Hand">
                                    <TextBlock Text="E" TextAlignment="Center" VerticalAlignment="Center" FontSize="12" Foreground="#FFFFFFFF" FontWeight="Bold" />
                                </Grid>
                                <Grid x:Name="PanUp" Width="20" Height="20" Background="#00FFFFFF" HorizontalAlignment="Center" VerticalAlignment="Top" ToolTipService.ToolTip="Click to move north" Cursor="Hand">
                                    <TextBlock Text="N" TextAlignment="Center" VerticalAlignment="Center" FontSize="12" Foreground="#FFFFFFFF" FontWeight="Bold" />
                                </Grid>
                                <Grid x:Name="PanDown" Width="20" Height="20" Background="#00FFFFFF" HorizontalAlignment="Center" VerticalAlignment="Bottom" ToolTipService.ToolTip="Click to move south" Cursor="Hand">
                                    <TextBlock Text="S" TextAlignment="Center" VerticalAlignment="Center" FontSize="12" Foreground="#FFFFFFFF" FontWeight="Bold" />
                                </Grid>

                            </Grid>

                            <Ellipse x:Name="GlobeGlass" Fill="#00FFFFFF" StrokeThickness="0" Width="80" Height="80" HorizontalAlignment="Center" VerticalAlignment="Center" ToolTipService.ToolTip="Drag to rotate" Cursor="Hand" Stroke="#66FFFFFF" Grid.Column="1">
                            </Ellipse>


                            <Button x:Name="ZoomFullExtent" Height="25" FontSize="8" Width="25" ToolTipService.ToolTip="Full Extent" HorizontalAlignment="Left" VerticalAlignment="Bottom" Grid.Column="1" Margin="5" Foreground="White" Padding="0">
                                <Button.Content>
                                    <Grid Height="20" Width="20">
                                        <Ellipse Height="Auto" Width="Auto" Stroke="{StaticResource FillColor}" />
                                        <Ellipse Height="6" Width="Auto" Stroke="{StaticResource FillColor}" />
                                        <Ellipse Height="Auto" Width="6" Stroke="{StaticResource FillColor}" />
                                    </Grid>
                                </Button.Content>
                            </Button>
                            <Button x:Name="ResetRotation" Height="25" FontSize="8" Width="25" ToolTipService.ToolTip="Reset Map Rotation" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Column="1" Margin="5" Foreground="White" Padding="0">
                                <Button.Content>
                                    <Grid Height="Auto" HorizontalAlignment="Left" Width="Auto" RenderTransformOrigin="0.5,0.5">
                                        <Grid.RenderTransform>
                                            <RotateTransform Angle="0" />
                                        </Grid.RenderTransform>
                                        <Path Height="12" Width="10" RenderTransformOrigin="0.5,0.5" Data="M49.643433,70.53167 L37.857143,76 L49.572575,81.46917 z" Fill="{StaticResource FillColor}" Stretch="Fill">
                                            <Path.RenderTransform>
                                                <RotateTransform Angle="90" />
                                            </Path.RenderTransform>
                                        </Path>
                                        <Path Height="4" Margin="0,3,0,0" Width="4" Data="M92,29.833334 L92.000114,24.166691 L93.247681,24.184656 L96.134811,27.716934 L96.076241,24.166662 L97.444435,24.166662 L97.444435,29.833332 L96.218758,29.810295 L93.332748,26.418152 L93.361107,29.808037 z" Fill="#FF404040" Stretch="Fill" />
                                    </Grid>
                                </Button.Content>
                            </Button>
                        </Grid>
                    </ControlTemplate>

                </Setter.Value>
            </Setter>
        </Style>

        <!-- ScrollViewer Style -->
        <Style x:Key="ScrollBarStyleVertical" TargetType="ScrollBar">
            <Setter Property="MinWidth" Value="17" />
            <Setter Property="MinHeight" Value="17" />
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollBar">
                        <Grid x:Name="Root">
                            <Grid.Resources>
                                <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root" Background="Transparent">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalIncrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation" />
                                                        <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation" />
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight" />
                                                        <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" Fill="#FF1F3B53" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FF647480" Offset="1" />
                                                    <GradientStop Color="#FFAEB7BF" Offset="0" />
                                                    <GradientStop Color="#FF919EA7" Offset="0.35" />
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35" />
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle x:Name="BackgroundAnimation" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundGradient" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0.013" />
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.603" />
                                                    <GradientStop Color="#C6FFFFFF" Offset="1" />
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1" />
                                        <Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Height="8" Stretch="Uniform" Width="4">
                                            <Path.Fill>
                                                <SolidColorBrush x:Name="ButtonColor" Color="#FF333333" />
                                            </Path.Fill>
                                        </Path>
                                        <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver" />
                                                        <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed" />
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight" />
                                                        <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" Fill="#FF1F3B53" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                    <GradientStop Color="#FF647480" Offset="1" />
                                                    <GradientStop Color="#FFAEB7BF" Offset="0" />
                                                    <GradientStop Color="#FF919EA7" Offset="0.35" />
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35" />
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundGradient" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0.013" />
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.603" />
                                                    <GradientStop Color="#C6FFFFFF" Offset="1" />
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1" />
                                        <Path Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " Height="8" Stretch="Uniform" Width="4">
                                            <Path.Fill>
                                                <SolidColorBrush x:Name="ButtonColor" Color="#FF333333" />
                                            </Path.Fill>
                                        </Path>
                                        <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.7" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Path x:Name="path" Data="F1 M531.10699,321.94299 L541.53699,321.94299 L536.31653,331.72681 L531.10699,321.94299 z" Stretch="Uniform" Margin="4.666,4.917,4.494,4.666" UseLayoutRounding="False" Fill="{TemplateBinding Foreground}" />
                                        <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.7" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Path x:Name="path" Data="F1 M541.53699,173.589 L531.10699,173.589 L536.4436,164.94876 L541.53699,173.589 z" Stretch="Uniform" Margin="4.583,5.083,4.577,5.25" UseLayoutRounding="False" Fill="{TemplateBinding Foreground}" />
                                        <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.7" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To=".8" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ThumbVisual" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Grid x:Name="ThumbVisual" Margin="1,0,1,0">
                                            <Rectangle x:Name="Background" Fill="{TemplateBinding Foreground}" RadiusY="5" RadiusX="5" StrokeThickness="0" />
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalThumbTemplate" TargetType="Thumb">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver" />
                                                        <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed" />
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight" />
                                                        <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ThumbVisual" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Grid x:Name="ThumbVisual" Margin="0,1,0,1">
                                            <Rectangle x:Name="Background" Fill="#FF1F3B53" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                                <Rectangle.Stroke>
                                                    <LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
                                                        <GradientStop Color="#FF818F99" Offset="1" />
                                                        <GradientStop Color="#FFC2C9CE" Offset="0" />
                                                        <GradientStop Color="#FFB3BBC1" Offset="0.35" />
                                                        <GradientStop Color="#FF96A4B1" Offset="0.35" />
                                                    </LinearGradientBrush>
                                                </Rectangle.Stroke>
                                            </Rectangle>
                                            <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                            <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                            <Rectangle x:Name="BackgroundGradient" Margin="1" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                                        <GradientStop Color="#FFFFFFFF" Offset="0.013" />
                                                        <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                        <GradientStop Color="#E5FFFFFF" Offset="0.603" />
                                                        <GradientStop Color="#C6FFFFFF" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1" />
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </Grid.Resources>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver" />
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid x:Name="HorizontalRoot">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Rectangle Grid.ColumnSpan="5" RadiusY="1" RadiusX="1" Stroke="#00000000" StrokeThickness="1">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                            <GradientStop Color="#FFF4F6F7" Offset="0" />
                                            <GradientStop Color="#FFF0F4F7" Offset="0.344" />
                                            <GradientStop Color="#FFDFE3E6" Offset="1" />
                                            <GradientStop Color="#FFE9EEF4" Offset="0.527" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle Grid.ColumnSpan="5" Fill="{TemplateBinding Background}" RadiusY="1" RadiusX="1" Stroke="#00000000" StrokeThickness="1" />
                                <Rectangle Grid.ColumnSpan="5" Opacity=".375" RadiusY="1" RadiusX="1" StrokeThickness="1">
                                    <Rectangle.Stroke>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFA3AEB9" Offset="0" />
                                            <GradientStop Color="#FF8399A9" Offset="0.375" />
                                            <GradientStop Color="#FF718597" Offset="0.375" />
                                            <GradientStop Color="#FF617584" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Stroke>
                                </Rectangle>
                                <Rectangle Grid.ColumnSpan="5" Margin="1" RadiusY="1" RadiusX="1">
                                    <Rectangle.Stroke>
                                        <LinearGradientBrush EndPoint="0.5,.125" StartPoint=".5,.875">
                                            <GradientStop Color="#33FFFFFF" />
                                            <GradientStop Color="#99FFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Stroke>
                                </Rectangle>
                                <RepeatButton x:Name="HorizontalSmallDecrease" Grid.Column="0" IsTabStop="False" Interval="50" Margin="1" Template="{StaticResource HorizontalDecrementTemplate}" Width="16" />
                                <RepeatButton x:Name="HorizontalLargeDecrease" Grid.Column="1" IsTabStop="False" Interval="50" Template="{StaticResource RepeatButtonTemplate}" Width="0" />
                                <Thumb x:Name="HorizontalThumb" Background="{TemplateBinding Background}" Grid.Column="2" MinWidth="18" Template="{StaticResource HorizontalThumbTemplate}" Width="18" />
                                <RepeatButton x:Name="HorizontalLargeIncrease" Grid.Column="3" IsTabStop="False" Interval="50" Template="{StaticResource RepeatButtonTemplate}" />
                                <RepeatButton x:Name="HorizontalSmallIncrease" Grid.Column="4" IsTabStop="False" Interval="50" Margin="1" Template="{StaticResource HorizontalIncrementTemplate}" Width="16" />
                            </Grid>
                            <Grid x:Name="VerticalRoot" Visibility="Collapsed">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Rectangle RadiusY="1" RadiusX="1" Grid.RowSpan="5" Stroke="#00000000" StrokeThickness="1" Fill="#0CFFFFFF" />
                                <RepeatButton x:Name="VerticalSmallDecrease" Height="16" IsTabStop="False" Interval="50" Margin="1" Grid.Row="0" Template="{StaticResource VerticalDecrementTemplate}" Foreground="{TemplateBinding Foreground}" />
                                <RepeatButton x:Name="VerticalLargeDecrease" Height="0" IsTabStop="False" Interval="50" Grid.Row="1" Template="{StaticResource RepeatButtonTemplate}" />
                                <Thumb Margin="4,0" x:Name="VerticalThumb" Height="18" MinHeight="18" Grid.Row="2" Template="{StaticResource VerticalThumbTemplate}" />
                                <RepeatButton x:Name="VerticalLargeIncrease" IsTabStop="False" Interval="50" Grid.Row="3" Template="{StaticResource RepeatButtonTemplate}" />
                                <RepeatButton x:Name="VerticalSmallIncrease" Height="16" IsTabStop="False" Interval="50" Margin="1" Grid.Row="4" Template="{StaticResource VerticalIncrementTemplate}" Foreground="{TemplateBinding Foreground}" />
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Foreground" Value="White" />
        </Style>
        <Style x:Key="ScrollBarStyleHorizontal" TargetType="ScrollBar">
            <Setter Property="MinWidth" Value="17" />
            <Setter Property="MinHeight" Value="17" />
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollBar">
                        <Grid x:Name="Root">
                            <Grid.Resources>
                                <ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root" Background="Transparent">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalIncrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.7" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Path x:Name="path" Data="F1 M511.047,352.68201 L511.047,342.25201 L521.08331,347.46075 L511.047,352.68201 z" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Margin="5.167,4.667,4.25,4.491" UseLayoutRounding="False" />
                                        <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.7" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Path x:Name="path" Data="F1 M110.692,342.25201 L110.692,352.68201 L100.40163,347.46042 L110.692,342.25201 z" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Margin="3.75,4.583,5.5,4.575" UseLayoutRounding="False" />
                                        <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver" />
                                                        <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed" />
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight" />
                                                        <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" Fill="#FF1F3B53" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
                                                    <GradientStop Color="#FF647480" Offset="1" />
                                                    <GradientStop Color="#FFAEB7BF" Offset="0" />
                                                    <GradientStop Color="#FF919EA7" Offset="0.35" />
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35" />
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundGradient" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0.013" />
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.603" />
                                                    <GradientStop Color="#C6FFFFFF" Offset="1" />
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1" />
                                        <Path Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " Height="4" Stretch="Uniform" Width="8">
                                            <Path.Fill>
                                                <SolidColorBrush x:Name="ButtonColor" Color="#FF333333" />
                                            </Path.Fill>
                                        </Path>
                                        <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
                                    <Grid x:Name="Root">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver" />
                                                        <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundGradient" />
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed" />
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight" />
                                                        <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledElement" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Rectangle x:Name="Background" Fill="#FF1F3B53" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                            <Rectangle.Stroke>
                                                <LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
                                                    <GradientStop Color="#FF647480" Offset="1" />
                                                    <GradientStop Color="#FFAEB7BF" Offset="0" />
                                                    <GradientStop Color="#FF919EA7" Offset="0.35" />
                                                    <GradientStop Color="#FF7A8A99" Offset="0.35" />
                                                </LinearGradientBrush>
                                            </Rectangle.Stroke>
                                        </Rectangle>
                                        <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                        <Rectangle x:Name="BackgroundGradient" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0.013" />
                                                    <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                    <GradientStop Color="#E5FFFFFF" Offset="0.603" />
                                                    <GradientStop Color="#C6FFFFFF" Offset="1" />
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1" />
                                        <Path Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z " Height="4" Stretch="Uniform" Width="8">
                                            <Path.Fill>
                                                <SolidColorBrush x:Name="ButtonColor" Color="#FF333333" />
                                            </Path.Fill>
                                        </Path>
                                        <Rectangle x:Name="DisabledElement" Fill="#FFFFFFFF" Opacity="0" RadiusY="2" RadiusX="2" />
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundMouseOver" />
                                                        <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundPressed" />
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight" />
                                                        <ColorAnimation Duration="0" To="#6BFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#EAFFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                        <ColorAnimation Duration="0" To="#F4FFFFFF" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ThumbVisual" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Grid x:Name="ThumbVisual" Margin="1,0,1,0">
                                            <Rectangle x:Name="Background" Fill="#FF1F3B53" RadiusY="2" RadiusX="2" StrokeThickness="1">
                                                <Rectangle.Stroke>
                                                    <LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
                                                        <GradientStop Color="#FF818F99" Offset="1" />
                                                        <GradientStop Color="#FFC2C9CE" Offset="0" />
                                                        <GradientStop Color="#FFB3BBC1" Offset="0.35" />
                                                        <GradientStop Color="#FF96A4B1" Offset="0.35" />
                                                    </LinearGradientBrush>
                                                </Rectangle.Stroke>
                                            </Rectangle>
                                            <Rectangle x:Name="BackgroundMouseOver" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                            <Rectangle x:Name="BackgroundPressed" Fill="#FF448DCA" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#00000000" StrokeThickness="1" />
                                            <Rectangle x:Name="BackgroundGradient" Margin="1" RadiusY="1" RadiusX="1" Stroke="#FFFFFFFF" StrokeThickness="1">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
                                                        <GradientStop Color="#FFFFFFFF" Offset="0" />
                                                        <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                        <GradientStop Color="#E5FFFFFF" Offset="0.6" />
                                                        <GradientStop Color="#C6FFFFFF" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle x:Name="Highlight" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="1" RadiusX="1" Stroke="#FF6DBDD1" StrokeThickness="1" />
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                                <ControlTemplate x:Key="HorizontalThumbTemplate" TargetType="Thumb">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.7" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(Shape.StrokeThickness)" Storyboard.TargetName="Background" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0:0:0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ThumbVisual" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Grid x:Name="ThumbVisual" Margin="0,1,0,1">
                                            <Rectangle x:Name="Background" Fill="{TemplateBinding Foreground}" RadiusY="5" RadiusX="5" StrokeThickness="1" />
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </Grid.Resources>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver" />
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid x:Name="HorizontalRoot">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Rectangle Grid.ColumnSpan="5" RadiusY="1" RadiusX="1" Stroke="#00000000" StrokeThickness="1" Fill="#0CFFFFFF" />
                                <RepeatButton x:Name="HorizontalSmallDecrease" Grid.Column="0" IsTabStop="False" Interval="50" Margin="1" Template="{StaticResource HorizontalDecrementTemplate}" Width="16" Foreground="{TemplateBinding Foreground}" />
                                <RepeatButton x:Name="HorizontalLargeDecrease" Grid.Column="1" IsTabStop="False" Interval="50" Template="{StaticResource RepeatButtonTemplate}" Width="0" />
                                <Thumb Margin="0,4" x:Name="HorizontalThumb" Background="{TemplateBinding Background}" Grid.Column="2" MinWidth="18" Template="{StaticResource HorizontalThumbTemplate}" Width="18" />
                                <RepeatButton x:Name="HorizontalLargeIncrease" Grid.Column="3" IsTabStop="False" Interval="50" Template="{StaticResource RepeatButtonTemplate}" />
                                <RepeatButton x:Name="HorizontalSmallIncrease" Grid.Column="4" IsTabStop="False" Interval="50" Margin="1" Template="{StaticResource HorizontalIncrementTemplate}" Width="16" Foreground="{TemplateBinding Foreground}" />
                            </Grid>
                            <Grid x:Name="VerticalRoot" Visibility="Collapsed">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Rectangle RadiusY="1" RadiusX="1" Grid.RowSpan="5" Stroke="#00000000" StrokeThickness="1">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0,0.5" StartPoint="1,0.5">
                                            <GradientStop Color="#FFF4F6F7" Offset="0" />
                                            <GradientStop Color="#FFF0F4F7" Offset="0.344" />
                                            <GradientStop Color="#FFDFE3E6" Offset="1" />
                                            <GradientStop Color="#FFE9EEF4" Offset="0.527" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle Opacity=".375" RadiusY="1" RadiusX="1" Grid.RowSpan="5" StrokeThickness="1">
                                    <Rectangle.Stroke>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFA3AEB9" Offset="0" />
                                            <GradientStop Color="#FF8399A9" Offset="0.375" />
                                            <GradientStop Color="#FF718597" Offset="0.375" />
                                            <GradientStop Color="#FF617584" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Stroke>
                                </Rectangle>
                                <Rectangle Margin="1" RadiusY="1" RadiusX="1" Grid.RowSpan="5">
                                    <Rectangle.Stroke>
                                        <LinearGradientBrush EndPoint="0.125,0.5" StartPoint="0.875,0.5">
                                            <GradientStop Color="#33FFFFFF" />
                                            <GradientStop Color="#99FFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Stroke>
                                </Rectangle>
                                <RepeatButton x:Name="VerticalSmallDecrease" Height="16" IsTabStop="False" Interval="50" Margin="1" Grid.Row="0" Template="{StaticResource VerticalDecrementTemplate}" />
                                <RepeatButton x:Name="VerticalLargeDecrease" Height="0" IsTabStop="False" Interval="50" Grid.Row="1" Template="{StaticResource RepeatButtonTemplate}" />
                                <Thumb x:Name="VerticalThumb" Height="18" MinHeight="18" Grid.Row="2" Template="{StaticResource VerticalThumbTemplate}" />
                                <RepeatButton x:Name="VerticalLargeIncrease" IsTabStop="False" Interval="50" Grid.Row="3" Template="{StaticResource RepeatButtonTemplate}" />
                                <RepeatButton x:Name="VerticalSmallIncrease" Height="16" IsTabStop="False" Interval="50" Margin="1" Grid.Row="4" Template="{StaticResource VerticalIncrementTemplate}" />
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="ScrollViewer">
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="VerticalContentAlignment" Value="Top" />
            <Setter Property="VerticalScrollBarVisibility" Value="Visible" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="BorderBrush" Value="{x:Null}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollViewer">
                        <Border Background="{TemplateBinding Background}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <ScrollContentPresenter x:Name="ScrollContentPresenter" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" />
                                <Rectangle Grid.Column="1" Grid.Row="1" />
                                <ScrollBar x:Name="VerticalScrollBar" Grid.Column="1" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Margin="0,-1,-1,-1" Minimum="0" Orientation="Vertical" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" Width="18" Style="{StaticResource ScrollBarStyleVertical}" />
                                <ScrollBar x:Name="HorizontalScrollBar" Grid.Column="0" Height="18" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Margin="-1,0,-1,-1" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{TemplateBinding HorizontalOffset}" ViewportSize="{TemplateBinding ViewportWidth}" Style="{StaticResource ScrollBarStyleHorizontal}" Foreground="White" />
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Map Legend Style -->
        <Style TargetType="esri:Legend">
            <Setter Property="LayerItemsMode" Value="Flat" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="esri:Legend">
                        <ScrollViewer Background="{StaticResource BaseColor}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                            <ItemsControl ItemsSource="{TemplateBinding LayerItemsSource}" Foreground="White" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Vertical" Margin="5">
                                            <!--Layer Item-->
                                            <ContentPresenter Content="{Binding}" ContentTemplate="{Binding Template}" />
                                            <!--Legend Items-->
                                            <ItemsControl ItemsSource="{Binding LegendItems}">
                                                <ItemsControl.ItemTemplate>
                                                    <DataTemplate>
                                                        <ContentPresenter Content="{Binding}" ContentTemplate="{Binding Template}" />
                                                    </DataTemplate>
                                                </ItemsControl.ItemTemplate>
                                            </ItemsControl>
                                        </StackPanel>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                                <ItemsPresenter />
                            </ItemsControl>
                        </ScrollViewer>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>
</Application>