<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1chart="clr-namespace:C1.Silverlight.Chart;assembly=C1.Silverlight.Chart.5" xmlns:c1chartext="clr-namespace:C1.Silverlight.Chart.Extended" xmlns:c1="clr-namespace:C1.Silverlight;assembly=C1.Silverlight.5">

  <!-- @ General Thickness -->
  <Thickness x:Key="GeneralThickness">1</Thickness>

  <!-- @ Main Color Brush -->
  <Color x:Key="MainColor">#FF3C688D</Color>
  <SolidColorBrush x:Key="MainBrushColor" Color="{StaticResource MainColor}" />

  <!-- @ Border Brush -->
  <LinearGradientBrush x:Key="BorderBrush" 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>

  <!-- @ InnerBox Border Brush -->
  <Color x:Key="BoxColor">White</Color>
  <SolidColorBrush x:Key="BoxBrushColor" Color="{StaticResource BoxColor}" />

  <!-- @ InnerBox Border Style -->
  <Style x:Key="BoxStyle" TargetType="Border">
    <Setter Property="CornerRadius" Value="1" />
    <Setter Property="BorderBrush" Value="{StaticResource BoxBrushColor}" />
    <Setter Property="BorderThickness" Value="1" />
  </Style>

  <!-- @ MouseOver Background Brush -->
  <LinearGradientBrush x:Key="MouseOverGradientBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="#FFFFFFFF" Offset="0" />
    <GradientStop Color="#F9FFFFFF" Offset="0.4" />
    <GradientStop Color="#D8FFFFFF" Offset="0.6" />
    <GradientStop Color="#99FFFFFF" Offset="1" />
  </LinearGradientBrush>
  
  <!-- @ MouseOver Border Brush -->
  <LinearGradientBrush x:Key="MouseOverGradientBorderBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="#FF99C1E2" Offset="0.05" />
  </LinearGradientBrush>
  
  <!-- @ MouseOver Background & Border Style -->
  <Style x:Key="MouseOverStyle" TargetType="Border">
    <Setter Property="Background" Value="{StaticResource MouseOverGradientBrush}" />
    <Setter Property="BorderBrush" Value="{StaticResource MouseOverGradientBorderBrush}" />
    <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
    <Setter Property="CornerRadius" Value="2" />
    <Setter Property="IsHitTestVisible" Value="False" />
    <Setter Property="Opacity" Value="0" />
  </Style>
  
  <!-- @ TextBox MouseOver Background & Border Style -->
  <Style x:Key="MouseOverTextBoxStyle" TargetType="Border">
    <Setter Property="Background" Value="{StaticResource MouseOverGradientBrush}" />
    <Setter Property="BorderBrush" Value="{StaticResource MouseOverGradientBorderBrush}" />
    <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
    <Setter Property="CornerRadius" Value="2" />
    <Setter Property="IsHitTestVisible" Value="False" />
    <Setter Property="Opacity" Value="0" />
    <Setter Property="Margin" Value="0" />
  </Style>

  <!-- @ DropDown Button Background Brush -->
  <LinearGradientBrush x:Key="ComboGradientBrush" StartPoint="0,0" EndPoint="0,1">
    <GradientStop Color="#FFFFFFFF" Offset="0" />
    <GradientStop Color="#F9FFFFFF" Offset="0.4" />
    <GradientStop Color="#E5FFFFFF" Offset="0.6" />
    <GradientStop Color="#C6FFFFFF" Offset="1" />
  </LinearGradientBrush>

  <!-- @ Focus Background Brush -->
  <Color x:Key="FocusColor">#FF6DBDD1</Color>
  <SolidColorBrush x:Key="FocusColorBrush" Color="{StaticResource FocusColor}" />
  
  <!-- @ Focus Border Brush -->
  <LinearGradientBrush x:Key="FocusBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="{StaticResource FocusColor}" Offset="0" />
  </LinearGradientBrush>
  
  <!-- @ Focus Background & Border Style -->
  <Style x:Key="FocusStyle" TargetType="Border">
    <Setter Property="BorderBrush" Value="{StaticResource FocusBorderBrush}" />
    <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
    <Setter Property="CornerRadius" Value="2" />
    <Setter Property="Opacity" Value="0" />
  </Style>

  <!-- @ Disabled Background Brush -->
  <SolidColorBrush x:Key="DisabledBrush" Color="#B2FFFFFF" />

  <!-- @ Disabled Background & Border Style -->
  <Style x:Key="DisabledStyle" TargetType="Border">
    <Setter Property="Background" Value="{StaticResource DisabledBrush}" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="Opacity" Value="0" />
    <Setter Property="IsHitTestVisible" Value="False" />
    <Setter Property="CornerRadius" Value="2" />
  </Style>

  <!-- @ Slider Thumb Border Style -->
  <Style x:Key="SliderThumbBorderStyle" TargetType="Border">
    <Setter Property="Background" Value="{StaticResource MainBrushColor}" />
    <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
    <Setter Property="CornerRadius" Value="0" />
    <Setter Property="Width" Value="11" />
  </Style>

  <!-- @ Slider Thumb Style for Horizontal Orientation-->
  <Style x:Key="SliderThumbStyleH" TargetType="Thumb">
    <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Thumb">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="(UIElement.Opacity)">
                      <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                      <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused" />
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Style="{StaticResource SliderThumbBorderStyle}" Background="{TemplateBinding Background}" BorderThickness="0,0,0,0">
              <Border x:Name="Background" Style="{StaticResource SliderThumbBorderStyle}" Background="{StaticResource BoxBrushColor}" BorderBrush="{TemplateBinding BorderBrush}">
                <Grid Margin="1" Background="{TemplateBinding Background}">
                  <Border x:Name="BoxBorder" Background="{TemplateBinding Background}" />
                  <Border x:Name="BackgroundAnimation" Opacity="0" Background="{StaticResource MouseOverGradientBrush}" />
                  <Border x:Name="BackgroundGradient" Background="{StaticResource ComboGradientBrush}" c1:BackgroundGradientSuppressor.Background="{TemplateBinding Background}" />
                </Grid>
              </Border>
            </Border>
            <Rectangle Fill="{StaticResource MainBrushColor}" Margin="4" Width="2" IsHitTestVisible="False" />
            <Border x:Name="FocusVisualElement" Style="{StaticResource SliderThumbBorderStyle}" BorderBrush="{StaticResource FocusColorBrush}" Background="{x:Null}" BorderThickness="1" CornerRadius="1" Visibility="Collapsed" />
            <Border x:Name="DisabledVisualElement" BorderThickness="0,0,0,0" Style="{StaticResource SliderThumbBorderStyle}" Background="{StaticResource DisabledBrush}" Opacity="0" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- @ Slider Thumb Style for Horizontal Vertical-->
  <Style x:Key="SliderThumbStyleV" TargetType="Thumb">
    <Setter Property="Background" Value="{StaticResource MainBrushColor}" />
    <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Thumb">
          <Grid RenderTransformOrigin="0.5,0.5">
            <Grid.RenderTransform>
              <TransformGroup>
                <ScaleTransform />
                <SkewTransform />
                <RotateTransform Angle="-90" />
                <TranslateTransform />
              </TransformGroup>
            </Grid.RenderTransform>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
                      <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="(UIElement.Opacity)">
                      <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                      <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                      <DiscreteObjectKeyFrame KeyTime="00:00:00">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unfocused" />
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Style="{StaticResource SliderThumbBorderStyle}" Background="{TemplateBinding Background}" BorderThickness="0">
              <Border x:Name="Background" Style="{StaticResource SliderThumbBorderStyle}" Background="{StaticResource BoxBrushColor}" BorderBrush="{TemplateBinding BorderBrush}">
                <Grid Margin="1" Background="{TemplateBinding Background}">
                  <Border x:Name="BoxBorder" Background="{TemplateBinding Background}" />
                  <Border x:Name="BackgroundAnimation" Opacity="0" Background="{StaticResource MouseOverGradientBrush}" />
                  <Border x:Name="BackgroundGradient" Background="{StaticResource ComboGradientBrush}" c1:BackgroundGradientSuppressor.Background="{TemplateBinding Background}" />
                </Grid>
              </Border>
            </Border>
            <Border x:Name="FocusVisualElement" Style="{StaticResource SliderThumbBorderStyle}" Background="{x:Null}" BorderBrush="{StaticResource FocusColorBrush}" BorderThickness="{TemplateBinding BorderThickness}" Visibility="Collapsed" />
            <Border x:Name="DisabledVisualElement" Style="{StaticResource SliderThumbBorderStyle}" Background="{StaticResource DisabledBrush}" BorderThickness="0" Opacity="0" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- @ Slider Bar Style for Horizontal Orientation-->
  <Style x:Key="SliderBarH" TargetType="Rectangle">
    <Setter Property="Fill">
      <Setter.Value>
        <LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0">
          <GradientStop Color="#FFEDEDED" Offset="0" />
        </LinearGradientBrush>
      </Setter.Value>
    </Setter>
    <Setter Property="Stroke" Value="{StaticResource BorderBrush}" />
    <Setter Property="StrokeThickness" Value="1" />
    <Setter Property="RadiusX" Value="1" />
    <Setter Property="RadiusY" Value="1" />
    <Setter Property="Grid.ColumnSpan" Value="5" />
    <Setter Property="Grid.Column" Value="0" />
    <Setter Property="Margin" Value="5,3,5,3" />
  </Style>

  <!-- @ Slider Bar Style for Vertical Orientation-->
  <Style x:Key="SliderBarV" TargetType="Rectangle">
    <Setter Property="Fill">
      <Setter.Value>
        <LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0">
          <GradientStop Color="#FFEDEDED" Offset="0" />
        </LinearGradientBrush>
      </Setter.Value>
    </Setter>
    <Setter Property="Stroke" Value="{StaticResource BorderBrush}" />
    <Setter Property="RadiusX" Value="1" />
    <Setter Property="RadiusY" Value="1" />
    <Setter Property="StrokeThickness" Value="1" />
    <Setter Property="Grid.RowSpan" Value="5" />
    <Setter Property="Grid.Row" Value="0" />
    <Setter Property="Margin" Value="3,5,3,5" />
  </Style>

  <Style TargetType="c1chartext:AxisRangeSlider">
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="c1chartext:AxisRangeSlider">
          <c1chartext:ChartRangeSlider x:Name="RangeSlider" Orientation="Horizontal" Minimum="0" Maximum="1" LowerValue="0" UpperValue="1">
            <c1chartext:ChartRangeSlider.Template>
              <ControlTemplate TargetType="c1chartext:ChartRangeSlider">
                <Grid x:Name="Root">
                  <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                      <VisualState x:Name="Normal" />
                      <VisualState x:Name="Disabled" />
                      <VisualState x:Name="MouseOver" />
                    </VisualStateGroup>
                  </VisualStateManager.VisualStateGroups>

                  <!-- Horizontal Template -->
                  <Grid x:Name="HorizontalTemplate">
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="*" />
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="*" />
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
            		    <Grid x:Name="BackgroundImageGrid" Margin="5,0" Grid.ColumnSpan="5">
                    	<Image Stretch="Fill" Source="{TemplateBinding BackgroundImageSource}" />
                    </Grid>
            
                    <!-- Repeat Buttons + Thumb -->
                    <RepeatButton x:Name="DecreaseRepeatButton" Grid.Column="0" Background="Transparent" Opacity="0" IsTabStop="False" />
                    <Thumb x:Name="LowerThumb" Grid.Column="1" Background="{TemplateBinding Background}" Style="{StaticResource SliderThumbStyleH}" Opacity="0.7" Width="Auto" />
                    <Thumb x:Name="MiddleThumb" HorizontalAlignment="Stretch" Grid.Column="2" Background="{StaticResource MouseOverGradientBrush}" Opacity="0.6" IsTabStop="False" />
                    <Thumb x:Name="UpperThumb" Grid.Column="3" Background="{TemplateBinding Background}" Style="{StaticResource SliderThumbStyleH}" Opacity="0.7" />
                    <RepeatButton x:Name="IncreaseRepeatButton" Grid.Column="4" Background="Transparent" Opacity="0" IsTabStop="False" />

                    <!-- Focus indicator -->
                    <Rectangle x:Name="FocusVisual" Stroke="#666666" StrokeDashArray=".2 5" StrokeDashCap="Round" IsHitTestVisible="false" Grid.ColumnSpan="5" Opacity="0" />
                  </Grid>

                  <!-- Vertical Template -->
                  <Grid x:Name="VerticalTemplate" Visibility="Visible">
                    <Grid.RowDefinitions>
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="*" />
                      <RowDefinition Height="Auto" />
                      <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Rectangle Style="{StaticResource SliderBarV}" />

                    <!-- Repeat Buttons + Thumb -->
                    <RepeatButton x:Name="VerticalDecreaseRepeatButton" Grid.Row="4" Background="Transparent" Opacity="0" IsTabStop="False" />
                    <Thumb x:Name="VerticalLowerThumb" Grid.Row="3" Style="{StaticResource SliderThumbStyleV}" />
                    <Thumb x:Name="VerticalMiddleThumb" VerticalAlignment="Stretch" Grid.Row="2" Background="Transparent" Opacity="0" IsTabStop="False" />
                    <Thumb x:Name="VerticalUpperThumb" Grid.Row="1" Style="{StaticResource SliderThumbStyleV}" />
                    <RepeatButton x:Name="VerticalIncreaseRepeatButton" Grid.Row="0" Background="Transparent" Opacity="0" IsTabStop="False" />

                    <!-- Focus indicator -->
                    <Rectangle x:Name="VerticalFocusVisual" Stroke="#666666" StrokeDashArray=".2 5" StrokeDashCap="Round" IsHitTestVisible="false" Grid.RowSpan="5" Opacity="0" />
                  </Grid>
                </Grid>
              </ControlTemplate>

              </c1chartext:ChartRangeSlider.Template>
              </c1chartext:ChartRangeSlider>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>