<UserControl 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:c1="http://schemas.componentone.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:SunburstIntro"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.Resources>
            <local:EnumToStringConverter x:Key="EnumConverter" />
        </Grid.Resources>
        <Grid.DataContext>
            <local:SunburstViewModel />
        </Grid.DataContext>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel>
            <StackPanel.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="VerticalAlignment" Value="Center" />
                </Style>
                <Style TargetType="c1:C1NumericBox">
                    <Setter Property="Width" Value="40" />
                    <Setter Property="Height" Value="25" />
                    <Setter Property="Margin" Value="10 5" />
                </Style>
                <Style TargetType="ComboBox">
                    <Setter Property="Margin" Value="0 5 10 5" />
                    <Setter Property="ItemTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <TextBlock>
                                    <TextBlock.Inlines>
                                        <Run Text="Palette: " />
                                        <Run Text="{Binding Path=.}" />
                                    </TextBlock.Inlines>
                                </TextBlock>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </StackPanel.Resources>
            <WrapPanel Orientation="Horizontal">
                <WrapPanel.Resources>
                </WrapPanel.Resources>
            <TextBlock Text="Inner Radius"/>
            <c1:C1NumericBox Value="{Binding ElementName=sunburst, Path=InnerRadius, Mode=TwoWay}" Format="f1" Minimum="0" Maximum="1" Increment="0.1" />
                <StackPanel Orientation="Horizontal">
            <TextBlock Text="Offset" />
            <c1:C1NumericBox Value="{Binding ElementName=sunburst, Path=Offset, Mode=TwoWay}" Format="f1" Minimum="0" Maximum="1" Increment="0.1" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
            <TextBlock Text="Start Angle" />
            <c1:C1NumericBox Value="{Binding ElementName=sunburst, Path=StartAngle, Mode=TwoWay}" Minimum="-360" Maximum="360" Increment="45" />
                </StackPanel>
                <ComboBox ItemsSource="{Binding Palettes}" SelectedValue="{Binding ElementName=sunburst, Path=Palette, Converter={StaticResource EnumConverter}}"/>
            <CheckBox Content="Reversed" IsChecked="{Binding ElementName=sunburst, Path=Reversed, Mode=TwoWay}" VerticalContentAlignment="Center"/>
            </WrapPanel>
            <WrapPanel Orientation="Horizontal">
                <ComboBox ItemsSource="{Binding LabelPositions}" SelectedValue="{Binding ElementName=sunburst, Path=DataLabel.Position, Converter={StaticResource EnumConverter}}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock>
                                <TextBlock.Inlines>
                                    <Run Text="Label Position: " />
                                    <Run Text="{Binding Path=.}" />
                                </TextBlock.Inlines>
                            </TextBlock>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <ComboBox ItemsSource="{Binding LabelOverlapping}" SelectedValue="{Binding ElementName=sunburst, Path=DataLabel.Overlapping, Converter={StaticResource EnumConverter}}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock>
                                <TextBlock.Inlines>
                                    <Run Text="Label Overlapping: " />
                                    <Run Text="{Binding Path=.}" />
                                </TextBlock.Inlines>
                            </TextBlock>
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
            </WrapPanel>
        </StackPanel>
        <c1:C1Sunburst x:Name="sunburst" ItemsSource="{Binding HierarchicalData}" Binding="Value" BindingName="Year,Quarter,Month" ChildItemsPath="Items" ToolTipContent="{}{name}&#x000A;{y}" Grid.Row="1" >
            <c1:C1Sunburst.DataLabel>
                <c1:PieDataLabel Position="Center" Content="{}{name}={y}" Overlapping="Hide" />
            </c1:C1Sunburst.DataLabel>
        </c1:C1Sunburst>
    </Grid>
</UserControl>
