<Page
    x:Class="FlexChartExplorer.HitTest"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Chart="using:C1.Xaml.Chart"
    mc:Ignorable="d">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.Resources>
            <Chart:ChartStyle x:Key="titleFont" FontFamily="GenericMonospace" FontSize="20"></Chart:ChartStyle>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="100" />
        </Grid.RowDefinitions>
        <Chart:C1FlexChart Footer="{Binding HitTest_Footer, Source={StaticResource FlexChartExplorerLocalization}}"
                         Header="{Binding HitTest_Header, Source={StaticResource FlexChartExplorerLocalization}}"
                         HeaderStyle="{StaticResource titleFont}" FooterStyle="{StaticResource titleFont}" 
                         Binding="YVals" BindingX="XVals" ChartType="SplineSymbols" x:Name="flexChart"
                         PointerEntered="flexChart_PointerEntered"
                         PointerPressed="flexChart_PointerPressed">
            <Chart:C1FlexChart.Series>
                <Chart:Series x:Name="series0" SeriesName="Series 0"/>
                <Chart:Series x:Name="series1" SeriesName="Series 1" />
            </Chart:C1FlexChart.Series>
        </Chart:C1FlexChart>
        <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="20">
            <TextBlock x:Name="tbPosition1" Width="200"></TextBlock>
            <TextBlock x:Name="tbPosition2" Width="200" Margin="30 0"></TextBlock>
        </StackPanel>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="WideLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="540" />
                    </VisualState.StateTriggers>
                </VisualState>
                <VisualState x:Name="NarrowLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="tbPosition1.FontSize" Value="13" />
                        <Setter Target="tbPosition2.FontSize" Value="13" />
                        <Setter Target="tbPosition2.Margin" Value="0" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>
