<Page x:Class="FlexRadarIntro.RadarChart"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:Chart="using:C1.Xaml.Chart"
      xmlns:Xaml="using:C1.Xaml"
      xmlns:local="using:FlexRadarIntro"
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300">
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.Resources>
            <local:EnumConverter x:Key="enumConverter" />
        </Grid.Resources>
        <Grid.DataContext>
            <local:FlexRadarViewModel />
        </Grid.DataContext>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Xaml:C1WrapPanel Orientation="Horizontal" Margin="20">
            <Xaml:C1WrapPanel.Resources>
                <Style TargetType="ComboBox">
                    <Setter Property="Margin" Value="5 0 50 0" />
                    <Setter Property="Width" Value="150" />
                </Style>
                <Style TargetType="TextBlock">
                    <Setter Property="VerticalAlignment" Value="Center" />
                </Style>
                <Style TargetType="StackPanel">
                    <Setter Property="Orientation" Value="Horizontal" />
                    <Setter Property="Margin" Value="0 5" />
                </Style>
            </Xaml:C1WrapPanel.Resources>
            <StackPanel>
                <TextBlock Text="{Binding Source={StaticResource FlexRadarIntroLocalization}, Path=ChartType}"/>
                <ComboBox x:Name="cbChartType" ItemsSource="{Binding ChartTypes}" SelectedValue="{Binding ElementName=radarChart, Path=ChartType, Mode=TwoWay, Converter={StaticResource enumConverter}}" />
            </StackPanel>
            <StackPanel>
                <TextBlock Text="{Binding Source={StaticResource FlexRadarIntroLocalization}, Path=Stacking}" />
                <ComboBox x:Name="cbStacking" ItemsSource="{Binding Stackings}" SelectedValue="{Binding ElementName=radarChart, Path=Stacking, Mode=TwoWay, Converter={StaticResource enumConverter}}" />
            </StackPanel>
            <StackPanel>
                <TextBlock Text="{Binding Source={StaticResource FlexRadarIntroLocalization}, Path=Palette}"/>
                <ComboBox x:Name="cbPalette" ItemsSource="{Binding Palettes}" SelectedValue="{Binding ElementName=radarChart, Path=Palette, Mode=TwoWay, Converter={StaticResource enumConverter}}" />
            </StackPanel>
            <StackPanel>
                <TextBlock Text="{Binding Source={StaticResource FlexRadarIntroLocalization}, Path=StartAngle}" />
                <Xaml:C1NumericBox x:Name="nbStartingAngle" Minimum="0" Maximum="360" Increment="15" Width="200" Margin="5 0 10 0" Value="{Binding ElementName=radarChart, Path=StartAngle, Mode=TwoWay}" />
            </StackPanel>
            <CheckBox Content="{Binding Source={StaticResource FlexRadarIntroLocalization}, Path=Reversed}" VerticalAlignment="Center" IsChecked="{Binding ElementName=radarChart, Path=Reversed, Mode=TwoWay}" />
        </Xaml:C1WrapPanel>
        <Chart:C1FlexRadar x:Name="radarChart" Grid.Row="1" Binding="Value" BindingX="Name" ItemsSource="{Binding Points1}">
            <Chart:Series SeriesName="s1" />
            <Chart:Series SeriesName="s2" ItemsSource="{Binding Points2}" />
            <Chart:C1FlexRadar.AxisY>
                <Chart:Axis AxisLine="True" MajorTickMarks="Cross" Min="0" MajorGrid="True" />
            </Chart:C1FlexRadar.AxisY>
            <Chart:C1FlexRadar.DataLabel>
                <Chart:DataLabel Content="{}{Value}" />
            </Chart:C1FlexRadar.DataLabel>
        </Chart:C1FlexRadar>
    </Grid>
</Page>
