<Grid x:Name="flagRangeFinderContainer" Height="80" Width="300" Background="#FFDDDDDD">
<local:RangeFinder x:Name="rangeFinder2" Height="70" Width="200" VerticalAlignment="Bottom" HorizontalAlignment="Center"
Minimum="10" Maximum="90" Value="20" UpperValue="70"
Background="Green">
<local:RangeFinder.Style>
<Style TargetType="local:RangeFinder">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:RangeFinder">
<Grid x:Name="RootElement" Background="Transparent">
<Grid x:Name="TrackElement">
<Grid.Resources>
<SolidColorBrush x:Key="EndCap" Color="#55000000"/>
<LinearGradientBrush x:Key="VerticalShadow" StartPoint="0,0" EndPoint="0,1">
<GradientStopCollection>
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="Transparent" Offset="1"/>
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="HorizontalShadow" StartPoint="0,0" EndPoint="1,0">
<GradientStopCollection>
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="Transparent" Offset="1"/>
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="SoutheastShadow" StartPoint="0,0" EndPoint="1,1">
<GradientStopCollection>
<GradientStop Color="Black" Offset=".32"/>
<GradientStop Color="Transparent" Offset=".59"/>
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="RaisedShadow" StartPoint="0,1" EndPoint="0,0">
<GradientStopCollection>
<GradientStop Color="#AA000000" Offset=".2"/>
<GradientStop Color="Transparent" Offset=".8"/>
</GradientStopCollection>
</LinearGradientBrush>
<LinearGradientBrush x:Key="TrackShadow" StartPoint="0,1" EndPoint="0,0">
<GradientStopCollection>
<GradientStop Color="#88000000" Offset=".2"/>
<GradientStop Color="Transparent" Offset=".7"/>
<GradientStop Color="Transparent" Offset=".8"/>
<GradientStop Color="#88000000" Offset=".95"/>
</GradientStopCollection>
</LinearGradientBrush>
<Style x:Key="valueTextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="Trebuchet MS"/>
<Setter Property="FontSize" Value="11"/>
</Style>
<Style x:Key="RightGridSplitter" TargetType="GridSplitter">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GridSplitter">
<Grid x:Name="RootElement" IsHitTestVisible="{TemplateBinding IsEnabled}">
<Grid.RowDefinitions>
<RowDefinition Height="26"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="6"/>
</Grid.ColumnDefinitions>
<!-- Inner Shadow -->
<Rectangle Grid.Row="0" Grid.Column="1" Margin="-.1,5.9,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="4" Fill="{StaticResource VerticalShadow}"/>
<Rectangle Grid.Row="0" Grid.Column="1" Margin="-.1,6,0,6" VerticalAlignment="Stretch" HorizontalAlignment="Left" Width="4" Fill="{StaticResource HorizontalShadow}">
<Rectangle.Clip>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="0,0">
<PathFigure.Segments>
<LineSegment Point="5,5"/>
<LineSegment Point="5,26"/>
<LineSegment Point="0,26"/>
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Rectangle.Clip>
</Rectangle>
<!-- Outer Shadow -->
<Rectangle Grid.Row="0" Grid.Column="1" Margin="0,0,0,-3.9" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="4" Fill="{StaticResource VerticalShadow}"/>
<Rectangle Grid.Row="0" Grid.Column="2" Margin="0,2,-2.9,5" VerticalAlignment="Stretch" HorizontalAlignment="Right" Width="4" Fill="{StaticResource HorizontalShadow}"/>
<Rectangle Grid.Row="0" Grid.Column="2" Margin="0,0,-2,-3" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="8" Width="8" Fill="{StaticResource SoutheastShadow}"/>
<!-- Stem and Shadow -->
<Rectangle Grid.Row="1" Grid.Column="0" Margin="0,-1,0,-1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{TemplateBinding Background}"/>
<Rectangle Grid.Row="1" Grid.Column="0" Margin="0,-1,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{StaticResource RaisedShadow}"/>
<!-- Flag Shape -->
<Polygon Grid.Row="0" Grid.Column="0" Points="0,26 0,5 5,0 6,0 6,26" Fill="{TemplateBinding Background}" />
<Rectangle Grid.Row="0" Grid.Column="1" Margin="-1,0,0,0" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="6" />
<Rectangle Grid.Row="0" Grid.Column="1" Margin="-1,0,0,0" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="6" />
<Polygon Grid.Row="0" Grid.Column="2" Margin="-1,0,0,0" Points="0,26 0,0 6,0 6,21 1,26" Fill="{TemplateBinding Background}"/>
<TextBlock Grid.Row="0" Grid.Column="1" Margin="0,2,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding FormattedUpperValue, Mode=OneWay}" Style="{StaticResource valueTextBlockStyle}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="LeftGridSplitter" TargetType="GridSplitter">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GridSplitter">
<Grid x:Name="RootElement" IsHitTestVisible="{TemplateBinding IsEnabled}">
<Grid.RowDefinitions>
<RowDefinition Height="26"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="6"/>
</Grid.ColumnDefinitions>
<!-- Inner Shadow -->
<Rectangle Grid.Row="0" Grid.Column="1" Margin="-.1,5.9,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="4" Fill="{StaticResource VerticalShadow}"/>
<Rectangle Grid.Row="0" Grid.Column="1" Margin="-.1,6,0,6" VerticalAlignment="Stretch" HorizontalAlignment="Left" Width="4" Fill="{StaticResource HorizontalShadow}">
<Rectangle.Clip>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="0,0">
<PathFigure.Segments>
<LineSegment Point="5,5"/>
<LineSegment Point="5,26"/>
<LineSegment Point="0,26"/>
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Rectangle.Clip>
</Rectangle>
<!-- Outer Shadow -->
<Rectangle Grid.Row="0" Grid.Column="1" Margin="0,0,0,-3.9" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="4" Height="4" Fill="{StaticResource VerticalShadow}">
<Rectangle.Clip>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="0,0">
<PathFigure.Segments>
<LineSegment Point="5,5"/>
<LineSegment Point="26,5"/>
<LineSegment Point="26,0"/>
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Rectangle.Clip>
</Rectangle>
<Rectangle Grid.Row="0" Grid.Column="1" Margin="3.9,0,0,-3.9" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="4" Fill="{StaticResource VerticalShadow}"/>
<Rectangle Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" Margin="0,7,-3.9,0" VerticalAlignment="Stretch" HorizontalAlignment="Right" Width="4" Fill="{StaticResource HorizontalShadow}">
<Rectangle.Clip>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="0,0">
<PathFigure.Segments>
<LineSegment Point="5,5"/>
<LineSegment Point="5,26"/>
<LineSegment Point="0,26"/>
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Rectangle.Clip>
</Rectangle>
<!-- Stem and Shadow -->
<Rectangle Grid.Row="1" Grid.Column="2" Margin="0,-1,0,-1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{TemplateBinding Background}"/>
<Rectangle Grid.Row="1" Grid.Column="2" Margin="0,-1,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{StaticResource RaisedShadow}"/>
<!-- Flag Shape -->
<Polygon Grid.Row="0" Grid.Column="2" Points="0,26 0,0 1,0 6,5 6,26" Fill="{TemplateBinding Background}" />
<Rectangle Grid.Row="0" Grid.Column="1" Margin="-1,0,-1,0" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="6" />
<Rectangle Grid.Row="0" Grid.Column="1" Margin="-1,0,-1,0" Fill="{TemplateBinding Background}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="6" />
<Polygon Grid.Row="0" Grid.Column="0" Margin="0,0,-1,0" Points="0,21 0,0 6,0 6,26 5,26" Fill="{TemplateBinding Background}"/>
<TextBlock Grid.Row="0" Grid.Column="1" Margin="0,2,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding FormattedValue, Mode=OneWay}" Style="{StaticResource valueTextBlockStyle}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="6"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Placeholder rectangles for measuring - should never be displayed -->
<Rectangle x:Name="LeftTrackElement" Grid.Column="0" Grid.RowSpan="3" Fill="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
<Rectangle x:Name="RightTrackElement" Grid.Column="2" Grid.RowSpan="3" Fill="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
<!-- The two thumbs -->
<GridSplitter x:Name="LeftGridSplitterElement" Style="{StaticResource LeftGridSplitter}" Grid.Column="0" HorizontalAlignment="Right" Width="{TemplateBinding ThumbWidth}" Background="{TemplateBinding Background}" VerticalAlignment="Bottom" Height="30"/>
<GridSplitter x:Name="RightGridSplitterElement" Style="{StaticResource RightGridSplitter}" Grid.Column="2" HorizontalAlignment="Left" Width="{TemplateBinding ThumbWidth}" Background="{TemplateBinding Background}" VerticalAlignment="Bottom" Height="30"/>
<!-- The track and its shadow -->
<Rectangle Grid.Row="1" Margin="{TemplateBinding TrackMargin}" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{TemplateBinding Background}"/>
<Rectangle Grid.Row="1" Margin="{TemplateBinding TrackMargin}" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="{StaticResource TrackShadow}"/>
<!-- The end caps for the track -->
<Rectangle Grid.Row="1" Margin="{TemplateBinding TrackMargin}" Width="1" HorizontalAlignment="Left" VerticalAlignment="Stretch" Fill="{StaticResource EndCap}"/>
<Rectangle Grid.Row="1" Grid.Column="2" Margin="{TemplateBinding TrackMargin}" Width="1" HorizontalAlignment="Right" VerticalAlignment="Stretch" Fill="{StaticResource EndCap}"/>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="DarkGray"/>
<Setter Property="ThumbWidth" Value="40"/>
</Style>
</local:RangeFinder.Style>
</local:RangeFinder>
</Grid>