<Page
    x:Class="GaugeSamples.LinearGauge"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:GaugeSamples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1="using:C1.Xaml.Gauge"
    mc:Ignorable="d"
    >
    <Page.Resources>
        <DataTemplate x:Key="ValueFaceTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Text="0"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" Margin="20" Opacity="0.6" />
                <TextBlock Text="100" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16" Margin="20" Opacity="0.6" />
            </Grid>
        </DataTemplate>
        <local:ValueTextConverter x:Key="Converter"/>
    </Page.Resources>
    <Grid HorizontalAlignment="Stretch">
        <c1:C1LinearGauge x:Name="myGauge" Height="80" PointerVisibility="Collapsed" Background="Transparent" Orientation="Horizontal" Value="25" BorderThickness="2"  XAxisLength="0.9" XAxisLocation="0.05" 
                          FaceTemplate="{StaticResource ValueFaceTemplate}"
                            PointerMoved="OnPointerMoved" PointerPressed="OnPointerPressed" PointerReleased="OnPointerReleased" >
            <c1:C1GaugeRange To="100" Fill="White" Stroke="#C0C0C0" Width="0.6" Location="0.2" StrokeThickness="2"/>
            <c1:C1GaugeRange To="{Binding ElementName=myGauge,Path=Value}" Width="0.6" Location="0.2" Fill="#0085C7" />
        </c1:C1LinearGauge>
        <TextBlock Text="{Binding ElementName=myGauge,Path=Value,Converter={StaticResource Converter}}" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,60,0,-60" FontSize="28" FontWeight="Bold" />
    </Grid>
</Page>
