<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">
    <Page.Resources>
        <ResourceDictionary>
            <Style x:Key="ComboBoxStyle" TargetType="ComboBox">
                <Setter Property="Margin" Value="5" />
                <Setter Property="Width" Value="170" />
                <Setter Property="DisplayMemberPath" Value="Key" />
                <Setter Property="SelectedValuePath" Value="Value" />
                <Setter Property="Foreground" Value="Black" />
                <Setter Property="Background" Value="LightBlue" />
            </Style>
        </ResourceDictionary>
    </Page.Resources>
    <Grid>
        <Grid.DataContext>
            <local:SampleData />
        </Grid.DataContext>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <CheckBox Grid.Row="0" Grid.Column="0" x:Name="showMarks" Content="{Binding MarksCB_Content, Source={StaticResource SparklineSamplesLocalization}}" IsChecked="{Binding ElementName=sparkline, Path=ShowMarkers, Mode=TwoWay}"/>
                <CheckBox Grid.Row="0" Grid.Column="1" x:Name="displayXAxis" Content="{Binding XAxisCB_Content, Source={StaticResource SparklineSamplesLocalization}}" RelativePanel.RightOf="showMarks" IsChecked="{Binding ElementName=sparkline, Path=DisplayXAxis, Mode=TwoWay}"/>
                <CheckBox Grid.Row="0" Grid.Column="2" x:Name="showFirst" Content="{Binding FirstCB_Content, Source={StaticResource SparklineSamplesLocalization}}" RelativePanel.RightOf="displayXAxis" IsChecked="{Binding ElementName=sparkline, Path=ShowFirst, Mode=TwoWay}" />
                <CheckBox Grid.Row="0" Grid.Column="3" x:Name="showLast" Content="{Binding LastCB_Content, Source={StaticResource SparklineSamplesLocalization}}" IsChecked="{Binding ElementName=sparkline, Path=ShowLast, Mode=TwoWay}"/>
                <CheckBox Grid.Row="1" Grid.Column="0" x:Name="showHigh" Content="{Binding HighCB_Content,Source={StaticResource SparklineSamplesLocalization}}" RelativePanel.RightOf="showLast" IsChecked="{Binding ElementName=sparkline, Path=ShowHigh, Mode=TwoWay}"/>
                <CheckBox Grid.Row="1" Grid.Column="1" x:Name="showLow" Content="{Binding LowCB_Content, Source={StaticResource SparklineSamplesLocalization}}" RelativePanel.RightOf="showHigh" IsChecked="{Binding ElementName=sparkline, Path=ShowLow, Mode=TwoWay}"/>
                <CheckBox Grid.Row="1" Grid.Column="2" x:Name="showNegative" Content="{Binding NegativeCB_Content, Source={StaticResource SparklineSamplesLocalization}}" IsChecked="{Binding ElementName=sparkline, Mode=TwoWay, Path=ShowNegative}"/>
            </Grid>
        </ScrollViewer>
        <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <StackPanel Orientation="Horizontal">
                    <ComboBox x:Name="sparklineType" Header="{Binding SparklineTypeTB_Text, Source={StaticResource SparklineSamplesLocalization}}" ItemsSource="{Binding SparklineTypes}" Style="{StaticResource ComboBoxStyle}"/>
                    <ComboBox x:Name="SeriesColor" Header="{Binding SeriesColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" ItemsSource="{Binding DefaultColors}" Style="{StaticResource ComboBoxStyle}"/>
                    <ComboBox x:Name="MarksColor" Header="{Binding MarksColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" ItemsSource="{Binding DefaultColors}" Style="{StaticResource ComboBoxStyle}"/>
                    <ComboBox x:Name="FirstMarkColor" Header="{Binding FirstMarkColorTB_Text,Source={StaticResource SparklineSamplesLocalization}}" ItemsSource="{Binding DefaultColors}" Style="{StaticResource ComboBoxStyle}"/>
                    <ComboBox x:Name="HightMarkColor" Header="{Binding HighMarkColorTB_Text,Source={StaticResource SparklineSamplesLocalization}}" ItemsSource="{Binding DefaultColors}" Style="{StaticResource ComboBoxStyle}"/>
                </StackPanel>
                <StackPanel Grid.Row="1" Orientation="Horizontal">
                    <ComboBox x:Name="LowMarkColor" Header="{Binding LowMarkColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" ItemsSource="{Binding DefaultColors}" Style="{StaticResource ComboBoxStyle}"/>
                    <ComboBox x:Name="XAxisColor" Header="{Binding AxisColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" ItemsSource="{Binding DefaultColors}" Style="{StaticResource ComboBoxStyle}"/>
                    <ComboBox x:Name="LastMarkColor" Header="{Binding LastMarkColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" ItemsSource="{Binding DefaultColors}" Style="{StaticResource ComboBoxStyle}"/>
                    <ComboBox x:Name="NegativeColor" Header="{Binding NegativeColorTB_Text, Source={StaticResource SparklineSamplesLocalization}}" ItemsSource="{Binding DefaultColors}" Style="{StaticResource ComboBoxStyle}"/>
                </StackPanel>
            </Grid>
        </ScrollViewer>
        <Grid x:Name="_grid" Grid.Row="2" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="4">
            <c1:C1Sparkline x:Name="sparkline" Data="{Binding DefaultData}" HorizontalAlignment="Left" Margin="4"
                            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">
            </c1:C1Sparkline>
        </Grid>
    </Grid>
</Page>