<UserControl
    x:Class="GestureChartSample.GestureChartDemo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:GestureChartSample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:Chart="http://schemas.componentone.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" >
    <Grid>
        <Grid.DataContext>
            <local:GestureChartDemoModel />
        </Grid.DataContext>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border BorderBrush="LightGray" BorderThickness="1">
            <StackPanel Orientation="Horizontal" Margin="0 10">
                <Image Source="/GestureChartSample.4;component/Resources/C1.png" Width="80" Height="80"/>
                <Grid Margin="20 0">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Text="Gesture Chart" FontWeight="Bold" FontSize="25" VerticalAlignment="Bottom" />
                    <TextBlock Text="{Binding Description}" Grid.Row="1" />
                </Grid>
            </StackPanel>
        </Border>
        <Grid Margin="20 0" Grid.Row="1">
            <Grid.Resources>
                <local:GestureModeToStringConverter x:Key="gestureModeConverter" />
            </Grid.Resources>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <StackPanel x:Name="stackPanel" Orientation="Horizontal" Margin="0 10">
                <ComboBox x:Name="cbZoomMode" ItemsSource="{Binding GestureMode}" Width="200"
                      SelectedValue="{Binding ElementName=gestureChart, Path=Behaviors[0].ZoomMode, Mode=TwoWay, Converter={StaticResource gestureModeConverter}}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock>
                                <TextBlock.Inlines>
                                    <Run Text="Zoom Mode:"/>
                                    <Run Text="{Binding Path=.}" />
                                </TextBlock.Inlines>
                            </TextBlock>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <StackPanel Orientation="Horizontal">
                    <ComboBox x:Name="cbTranslationMode" ItemsSource="{Binding GestureMode}" Width="250" Margin="20 0"
                      SelectedValue="{Binding ElementName=gestureChart, Path=Behaviors[1].TranslationMode, Mode=TwoWay, Converter={StaticResource gestureModeConverter}}">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock>
                                    <TextBlock.Inlines>
                                        <Run Text="Translation Mode:"></Run>
                                        <Run Text="{Binding Path=.}" />
                                    </TextBlock.Inlines>
                                </TextBlock>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                    <Button Content="Reset Zoom" x:Name="btnResetZoom" Click="OnResetButtonClick" Width="150"/>
                </StackPanel>
            </StackPanel>
            <Chart:C1FlexChart x:Name="gestureChart" ChartType="Scatter" Header="Gesture Chart" ToolTip="{x:Null}" Margin="0 10"
                ItemsSource="{Binding Data}" RenderMode="Direct2D" Grid.Row="1">
                <Chart:C1FlexChart.HeaderStyle>
                    <Chart:ChartStyle FontSize="20" />
                </Chart:C1FlexChart.HeaderStyle>
                <Chart:C1FlexChart.Behaviors>
                    <Chart:ZoomBehavior />
                    <Chart:TranslateBehavior />
                </Chart:C1FlexChart.Behaviors>
                <Chart:Series x:Name="Function1" BindingX="XVals" Binding="YVals"/>
                <Chart:C1FlexChart.AxisY>
                    <Chart:Axis AxisLine="True" Title="Y Axis"  />
                </Chart:C1FlexChart.AxisY>
            </Chart:C1FlexChart>
        </Grid>
    </Grid>
</UserControl>