<UserControl
    x:Class="FlexChartExplorer.PieSliceColor"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:FlexChartExplorer"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Chart="http://schemas.componentone.com/winfx/2006/xaml"
    DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
    mc:Ignorable="d">
    <Grid>
        <Grid.Resources>
            <local:AnimationSettingsToBoolConverter x:Key="animCnv" />
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" x:Name="panel">
            <Button x:Name="btnNew" Margin="8" Padding="4" Content="New Data" Click="btnNew_Click"  />
            <Button x:Name="btnUpdate" Margin="8" Padding="4" Content="Update" Click="btnUpdate_Click" />
            <CheckBox Margin="8" VerticalAlignment="Center" Content="Animation" IsChecked="{Binding ElementName=pieChart,Path=AnimationSettings,Converter={StaticResource animCnv}}" />
        </StackPanel>
        <Chart:C1FlexPie x:Name="pieChart" Grid.Row="1" Binding="Value" BindingName="Name" LegendPosition="None" Loaded="pieChart_Loaded" SliceRendering="pieChart_SliceRendering" >
            <Chart:C1FlexPie.DataLabel>
                <Chart:PieDataLabel Content="{}{Name}" Position="Center" Border="True">
                    <Chart:PieDataLabel.BorderStyle>
                        <Chart:ChartStyle Stroke="Transparent" Fill="WhiteSmoke" />
                    </Chart:PieDataLabel.BorderStyle>
                </Chart:PieDataLabel>
            </Chart:C1FlexPie.DataLabel>
        </Chart:C1FlexPie>
    </Grid>
</UserControl>
