<Page x:Class="SunburstIntro.BasicFeatures"
      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:SunburstIntro"
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300">
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="10">
        <Grid.Resources>
            <local:EnumToStringConverter x:Key="PaletteConverter" />
        </Grid.Resources>
        <Grid.DataContext>
            <local:SunburstViewModel />
        </Grid.DataContext>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="10">
            <StackPanel.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="VerticalAlignment" Value="Center" />
                </Style>
                <Style TargetType="Xaml:C1NumericBox">
                    <Setter Property="Width" Value="160" />
                    <Setter Property="Height" Value="25" />
                    <Setter Property="Margin" Value="5 0 30 0" />
                </Style>
                <Style TargetType="ComboBox">
                    <Setter Property="Width" Value="200" />
                    <Setter Property="Margin" Value="0 0 10 0" />
                    <Setter Property="ItemTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <TextBlock>
                                    <TextBlock.Inlines>
                                        <Run Text="{Binding Source={StaticResource SunburstIntroLocalization}, Path=Palette}" />
                                        <Run Text="{Binding}" />
                                    </TextBlock.Inlines>
                                </TextBlock>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </StackPanel.Resources>
            <TextBlock Text="{Binding Source={StaticResource SunburstIntroLocalization}, Path=InnerRadius}" />
            <Xaml:C1NumericBox Value="{Binding ElementName=sunburst, Path=InnerRadius, Mode=TwoWay}" Format="f1" Minimum="0" Maximum="1" Increment="0.1" />
            <TextBlock Text="{Binding Source={StaticResource SunburstIntroLocalization}, Path=Offset}" />
            <Xaml:C1NumericBox Value="{Binding ElementName=sunburst, Path=Offset, Mode=TwoWay}" Format="f1" Minimum="0" Maximum="1" Increment="0.1" />
            <TextBlock Text="{Binding Source={StaticResource SunburstIntroLocalization}, Path=StartAngle}" />
            <Xaml:C1NumericBox Value="{Binding ElementName=sunburst, Path=StartAngle, Mode=TwoWay}" Minimum="-360" Maximum="360" Increment="45" />
            <ComboBox ItemsSource="{Binding Palettes}" SelectedValue="{Binding ElementName=sunburst, Path=Palette, Converter={StaticResource PaletteConverter}, Mode=TwoWay}"/>
            <CheckBox Content="{Binding Source={StaticResource SunburstIntroLocalization}, Path=Reversed}" IsChecked="{Binding ElementName=sunburst, Path=Reversed, Mode=TwoWay}" />
        </StackPanel>
        <Chart:C1Sunburst x:Name="sunburst" ItemsSource="{Binding HierarchicalData}" Binding="Value" BindingName="Year,Quarter,Month" ChildItemsPath="Items" ToolTipContent="{}{name}&#x000A;{y}" Grid.Row="1" >
            <Chart:C1Sunburst.DataLabel>
                <Chart:PieDataLabel Position="Center" Content="{}{name}" />
            </Chart:C1Sunburst.DataLabel>
        </Chart:C1Sunburst>
    </Grid>
</Page>
