<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="DynamicConditionalFormatting.VisualRangeSlider" x:Name="_root" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008">
    <Border>
        <Grid x:Name="LayoutRoot" Background="{Binding Background, ElementName=_root}">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>

            <!-- histogram -->
            <Grid>
                <Polygon Name="_histogram" Points="0,0 0,1 1,1 1,4 2,4 2,2 3,2 3,6 4,6 4,16 5,16 5,10 6,10 6,5 7,5 7,6 8,6 8,4 9,4 9,0" Margin="5 0 5 -10" Fill="Orange" Stretch="Fill" RenderTransformOrigin="0,.5">
                    <Polygon.RenderTransform>
                        <ScaleTransform ScaleY="-1" />
                    </Polygon.RenderTransform>
                </Polygon>
            </Grid>
            <!-- range slider -->
            <!-- range slider -->
            <c1:C1RangeSlider Name="_slider" Grid.Row="1" FocusBrush="{x:Null}" />

            <!-- clear range-->
            <Button Name="_clear" Content="x" FontSize="7" Background="Red" VerticalAlignment="Top" HorizontalAlignment="Right" Padding="8 2" Click="_clear_Click" />

            <!-- show current range -->
            <TextBlock Name="_txtRange" VerticalAlignment="Top" HorizontalAlignment="Left" />
        </Grid>
    </Border>
</UserControl>