<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="using:GestureChartSample"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:Chart="using:C1.Xaml.Chart"
    xmlns:Interaction="using:C1.Xaml.Chart.Interaction"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <Grid Margin="20 0">
        <Grid.DataContext>
            <local:GestureChartDemoModel />
        </Grid.DataContext>
        <Grid.Resources>
            <local:GestureModeToStringConverter x:Key="gestureModeConverter" />
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <TextBlock Text="{Binding Source={StaticResource GestureChartSampleLocalization}, Path=Description}" Style="{ThemeResource CaptionTextBlockStyle}"/>
        <StackPanel x:Name="stackPanel" Orientation="Vertical" Grid.Row="1" Margin="0 10">
            <ComboBox x:Name="cbZoomMode" ItemsSource="{Binding GestureMode}" Width="180" FontSize="13"
                      SelectedValue="{Binding ElementName=gestureChart, Path=Behaviors[0].ZoomMode, Mode=TwoWay, Converter={StaticResource gestureModeConverter}}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock>
                            <TextBlock.Inlines>
                                <Run Text="{Binding Source={StaticResource GestureChartSampleLocalization}, Path=ZoomMode}"></Run>
                                <Run Text="{Binding}" />
                            </TextBlock.Inlines>
                        </TextBlock>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <StackPanel Orientation="Horizontal">
                <ComboBox x:Name="cbTranslationMode" ItemsSource="{Binding GestureMode}" FontSize="13" Width="180" Margin="0 0 5 0"
                      SelectedValue="{Binding ElementName=gestureChart, Path=Behaviors[1].TranslationMode, Mode=TwoWay, Converter={StaticResource gestureModeConverter}}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock>
                                <TextBlock.Inlines>
                                    <Run Text="{Binding Source={StaticResource GestureChartSampleLocalization}, Path=TranslationMode}"></Run>
                                    <Run Text="{Binding}" />
                                </TextBlock.Inlines>
                            </TextBlock>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <Button Content="Reset Zoom" x:Name="btnResetZoom" FontSize="12" Click="OnResetButtonClick" Width="90"/>
            </StackPanel>
        </StackPanel>
        <Chart:C1FlexChart x:Name="gestureChart" ChartType="Scatter" ToolTip="{x:Null}"
                ItemsSource="{Binding Data}" RenderMode="Direct2D" Grid.Row="2">
            <Chart:C1FlexChart.Behaviors>
                <Interaction:ZoomBehavior />
                <Interaction:TranslateBehavior />
            </Chart:C1FlexChart.Behaviors>
            <Chart:Series x:Name="Function1" BindingX="XVals" Binding="YVals"/>
        </Chart:C1FlexChart>
    </Grid>
</UserControl>