<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="GaugeBuilder.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:editors="clr-namespace:GaugeBuilder.Editors" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml">
    <UserControl.Resources>
        <Style x:Key="PropertiesScroll" TargetType="ScrollViewer">
            <Style.Setters>
                <Setter Property="MaxHeight" Value="200" />
                <Setter Property="Margin" Value="-6 -2 -6 -4" />
            </Style.Setters>
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">

        <Grid Background="WhiteSmoke">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <!-- Properties -->
            <ScrollViewer Margin="2 2 12 2">
                <c1:C1PropertyGrid x:Name="pgGeneral" AutoGenerateProperties="False" LabelWidth="150" EditorWidth="210">
                        <c1:C1PropertyGrid.PropertyAttributes>                            
                        <!-- Interaction -->
                            <c1:PropertyAttribute MemberName="InteractionMode" Category="General" />
                            <c1:PropertyAttribute MemberName="Value" Category="General" />
                        <!-- End Interaction -->

                        <!-- Srart Radial -->
                            <c1:PropertyAttribute MemberName="Minimum" Category="Scale" />
                            <c1:PropertyAttribute MemberName="Maximum" Category="Scale" />
                            <c1:PropertyAttribute MemberName="StartAngle" Category="Scale" MinimumValue="-360" MaximumValue="360" />
                            <c1:PropertyAttribute MemberName="SweepAngle" Category="Scale" MinimumValue="-360" MaximumValue="360" />
                            <c1:PropertyAttribute MemberName="Radius" Category="Scale" MinimumValue="0" MaximumValue="5" />
                            <c1:PropertyAttribute MemberName="OffAngle" Category="Scale" MinimumValue="-360" MaximumValue="360" />
                            <c1:PropertyAttribute MemberName="XAxisLocation" Category="Scale" MinimumValue="0" MaximumValue="5" />
                            <c1:PropertyAttribute MemberName="XAxisLength" Category="Scale" MinimumValue="0" MaximumValue="5" />
                            <c1:PropertyAttribute MemberName="Orientation" Category="Scale" />
                            <c1:PropertyAttribute MemberName="YAxisLocation" Category="Scale" MinimumValue="0" MaximumValue="5" />
                            <c1:PropertyAttribute MemberName="OffLocation" Category="Scale" MinimumValue="0" MaximumValue="5" />
                            <c1:PropertyAttribute MemberName="IsLogarithmic" Category="Scale" />
                            <c1:PropertyAttribute MemberName="LogarithmicBase" Category="Scale" MinimumValue="2" MaximumValue="100" />
                        <!-- End Scale -->

                        <!-- Appareance -->
                            <c1:PropertyAttribute MemberName="DecoratorsVisibility" Category="Appareance" />
                            <c1:PropertyAttribute MemberName="AutoDetectMarkTemplates" Category="Appareance" />
                            <c1:PropertyAttribute MemberName="Background" Category="Appareance" />
                            <c1:PropertyAttribute MemberName="BorderBrush" Category="Appareance" />
                            <c1:PropertyAttribute MemberName="BorderThickness" Category="Appareance">
                                <c1:PropertyAttribute.Editor>
                                    <editors:ThicknessEditor />
                                </c1:PropertyAttribute.Editor>
                            </c1:PropertyAttribute>
                            <c1:PropertyAttribute MemberName="Decorators" Category="Appareance" />
                        <!-- End Appareance -->

                        <!-- Pointer & Cap -->
                            <c1:PropertyAttribute MemberName="PointerLength" Category="Pointer &amp; Cap" MinimumValue="0" MaximumValue="2" />
                            <c1:PropertyAttribute MemberName="PointerWidth" Category="Pointer &amp; Cap" MinimumValue="0" MaximumValue="2" />
                            <c1:PropertyAttribute MemberName="PointerOffset" Category="Pointer &amp; Cap" MinimumValue="-2" MaximumValue="2" />
                            <c1:PropertyAttribute MemberName="PointerVisibility" Category="Pointer &amp; Cap" />
                            <c1:PropertyAttribute MemberName="PointerFill" Category="Pointer &amp; Cap" />
                            <c1:PropertyAttribute MemberName="PointerStroke" Category="Pointer &amp; Cap" />
                            <c1:PropertyAttribute MemberName="PointerStrokeThickness" Category="Pointer &amp; Cap" />
                            <c1:PropertyAttribute MemberName="PointerOrigin" Category="Pointer &amp; Cap" />
                            <c1:PropertyAttribute MemberName="PointerCapStyle" Category="Pointer &amp; Cap" />
                            <c1:PropertyAttribute MemberName="PointerCapSize" Category="Pointer &amp; Cap" />
                            <c1:PropertyAttribute MemberName="PointerCapFill" Category="Pointer &amp; Cap" />
                            <c1:PropertyAttribute MemberName="PointerCapStroke" Category="Pointer &amp; Cap" />
                            <c1:PropertyAttribute MemberName="PointerCapStrokeThickness" Category="Pointer &amp; Cap" />
                        <!-- End Pointer & Pointer Cap -->

                        </c1:C1PropertyGrid.PropertyAttributes>
                    </c1:C1PropertyGrid>
            </ScrollViewer>

            <!-- Splitter -->
            <controls:GridSplitter />

            <!-- Content -->
            <Grid Grid.Column="1">
                <ComboBox x:Name="comboGaugeType" Margin="0 20 20 0" Height="20" Width="100" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="11" SelectionChanged="comboGaugeType_SelectionChanged">
                    <ComboBoxItem Content="Radial" />
                    <ComboBoxItem Content="Linear" />
                    <ComboBoxItem Content="Knob" />
                </ComboBox>

                <Grid Margin="100" VerticalAlignment="Center" HorizontalAlignment="Center">

                    <!-- Linear -->
                    <c1:C1LinearGauge x:Name="linearGauge" Orientation="Horizontal" Visibility="Visible" Value="20" YAxisLocation="0.4" XAxisLocation="0.1" XAxisLength="0.8" OffLocation="0" Width="200" Height="80">
                        <c1:C1GaugeRange Fill="DarkRed" Opacity="0.3" StartWidth="0.1" EndWidth="0.25" />
                        <c1:C1GaugeRange Fill="Black" Width="0.01" />
                        <c1:C1GaugeMark Interval="20" />
                        <c1:C1GaugeMark Interval="10" />
                        <c1:C1GaugeLabel Interval="20" Alignment="In" />
                    </c1:C1LinearGauge>

                    <!-- Radial -->
                    <c1:C1RadialGauge x:Name="radialGauge" Visibility="Collapsed" Value="10" StartAngle="0" SweepAngle="300" PointerCapSize="0.1, 0.1" PointerLength="0.5" PointerOffset="-0.1" PointerWidth="0.1" PointerOrigin="0.5, 0.5" Width="300" Height="300" OffAngle="0">
                        <c1:C1GaugeRange StartWidth="1" EndWidth="0.2" StartLocation="0" EndLocation="0.8" Fill="DarkBlue" ValueBinding="To" Opacity="0.3" />
                        <c1:C1GaugeRange To="40" Location="0.8" Fill="Green" Stroke="Black" StrokeThickness="1" Width="0.2" Opacity="0.6" />
                        <c1:C1GaugeRange From="75" Fill="DarkRed" Location="0.9" Stroke="Black" StrokeThickness="1" Opacity="0.6" />
                        <c1:C1GaugeMark Interval="20" />
                        <c1:C1GaugeMark Interval="10" />
                        <c1:C1GaugeMark Interval="1" />
                        <c1:C1GaugeLabel Interval="20" Alignment="Out" AlignmentOffset="2" />
                    </c1:C1RadialGauge>

                    <!-- Knob -->
                    <c1:C1Knob x:Name="knobGauge" Visibility="Collapsed" Value="10" StartAngle="0" SweepAngle="360" Maximum="120" Width="300" Height="300" OffAngle="0" Radius="0.99">
                        <c1:C1GaugeRange To="60" Width="1" Location="0" Fill="Yellow" Opacity="0.5" />
                        <c1:C1GaugeRange From="60" To="90" Width="1" Location="0" Fill="Green" Opacity="0.5" />
                        <c1:C1GaugeRange From="90" Width="1" Location="0" Fill="Coral" Opacity="0.5" />
                        <c1:C1GaugeMark Interval="20" />
                        <c1:C1GaugeMark Interval="10" />
                        <c1:C1GaugeMark Interval="1" />
                        <c1:C1GaugeLabel Interval="20" Location="0.92" />
                    </c1:C1Knob>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</UserControl>