<Page
    x:Class="SparklineSamples.AppearanceSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SparklineSamples"
    xmlns:c1="using:C1.Xaml.Sparkline"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Grid>
        <Grid.DataContext>
            <local:SampleData />
        </Grid.DataContext>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" Margin="5">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Center" Padding="10">
                <StackPanel.Resources>
                    <Style TargetType="CheckBox">
                        <Setter Property="Margin" Value="0 2 2 2" />
                        <Setter Property="Width" Value="50" />
                        <Setter Property="MinWidth" Value="50" />
                    </Style>
                    <Style TargetType="TextBlock">
                        <Setter Property="Margin" Value="0 2 2 2" />
                        <Setter Property="VerticalAlignment" Value="Center" />
                    </Style>
                </StackPanel.Resources>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding ShowMarksTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <CheckBox x:Name="showMarks" IsChecked="{Binding ElementName=sparkline, Path=ShowMarkers, Mode=TwoWay}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding DisplayXAxisTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <CheckBox x:Name="displayXAxis" IsChecked="{Binding ElementName=sparkline, Path=DisplayXAxis, Mode=TwoWay}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding ShowFirstTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <CheckBox x:Name="showFirst" IsChecked="{Binding ElementName=sparkline, Path=ShowFirst, Mode=TwoWay}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding ShowLastTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <CheckBox x:Name="showLast" IsChecked="{Binding ElementName=sparkline, Path=ShowLast, Mode=TwoWay}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding ShowHighTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <CheckBox x:Name="showHigh" IsChecked="{Binding ElementName=sparkline, Path=ShowHigh, Mode=TwoWay}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding ShowLowTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <CheckBox x:Name="showLow" IsChecked="{Binding ElementName=sparkline, Path=ShowLow, Mode=TwoWay}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding ShowNegativeTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <CheckBox x:Name="showNegative" IsChecked="{Binding ElementName=sparkline, Mode=TwoWay, Path=ShowNegative}"/>
                </StackPanel>
            </StackPanel>
        </ScrollViewer>
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" Margin="5" Grid.Row="1">
            <StackPanel VerticalAlignment="Center" Padding="10">
                <StackPanel.Resources>
                    <Style TargetType="ComboBox">
                        <Setter Property="Margin" Value="5" />
                        <Setter Property="Width" Value="180" />
                        <Setter Property="Foreground" Value="Black" />
                        <Setter Property="SelectedValuePath" Value="Value" />
                        <Setter Property="DisplayMemberPath" Value="Key" />
                    </Style>
                    <Style TargetType="TextBlock">
                        <Setter Property="Width" Value="110" />
                        <Setter Property="Margin" Value="0 2 2 2" />
                        <Setter Property="VerticalAlignment" Value="Center" />
                    </Style>
                </StackPanel.Resources>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding SparklineTypeTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <ComboBox x:Name="sparklineType" ItemsSource="{Binding SparklineTypes}" DisplayMemberPath="Key" SelectedValuePath="Value" />
                    <TextBlock Text="{Binding SeriesColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <ComboBox x:Name="SeriesColor" ItemsSource="{Binding DefaultColors}" DisplayMemberPath="Key" SelectedValuePath="Value" />
                    <TextBlock Text="{Binding AxisColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <ComboBox x:Name="XAxisColor" ItemsSource="{Binding DefaultColors}" DisplayMemberPath="Key" SelectedValuePath="Value" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding MarksColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <ComboBox x:Name="MarksColor" ItemsSource="{Binding DefaultColors}" DisplayMemberPath="Key" SelectedValuePath="Value"/>
                    <TextBlock Text="{Binding FirstMarkColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <ComboBox x:Name="FirstMarkColor" ItemsSource="{Binding DefaultColors}" DisplayMemberPath="Key" SelectedValuePath="Value"/>
                    <TextBlock Text="{Binding LastMarkColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <ComboBox x:Name="LastMarkColor" ItemsSource="{Binding DefaultColors}" DisplayMemberPath="Key" SelectedValuePath="Value" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding HighMarkColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <ComboBox x:Name="HightMarkColor" ItemsSource="{Binding DefaultColors}" DisplayMemberPath="Key" SelectedValuePath="Value" />
                    <TextBlock Text="{Binding LowMarkColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" />
                    <ComboBox x:Name="LowMarkColor" ItemsSource="{Binding DefaultColors}" DisplayMemberPath="Key" SelectedValuePath="Value" />
                    <TextBlock Text="{Binding NegativeColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}"/>
                    <ComboBox x:Name="NegativeColor" ItemsSource="{Binding DefaultColors}" DisplayMemberPath="Key" SelectedValuePath="Value" />
                </StackPanel>
            </StackPanel>
        </ScrollViewer>
        <Grid Grid.Row="2" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="5">
            <c1:C1Sparkline x:Name="sparkline" Data="{Binding DefaultData}" 
                            SparklineType="{Binding ElementName=sparklineType, Path=SelectedValue}"
                            NegativeColor="{Binding ElementName=NegativeColor, Path=SelectedValue}" 
                            LowMarkerColor="{Binding ElementName=LowMarkColor, Path=SelectedValue}" 
                            HighMarkerColor="{Binding ElementName=HightMarkColor, Path=SelectedValue}"
                            LastMarkerColor="{Binding ElementName=LastMarkColor, Path=SelectedValue}" 
                            FirstMarkerColor="{Binding ElementName=FirstMarkColor, Path=SelectedValue}"
                            MarkersColor="{Binding ElementName=MarksColor, Path=SelectedValue}" 
                            SeriesColor="{Binding ElementName=SeriesColor, Path=SelectedValue}"
                            AxisColor="{Binding ElementName=XAxisColor, Path=SelectedValue}" DisplayXAxis="True" ShowFirst="True" ShowLast="True" ShowLow="True"/>
        </Grid>
    </Grid>
</Page>