<UserControl xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"  x:Class="DataManipulation.AggregateView"
            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:local="clr-namespace:DataManipulation"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.Resources>
            <local:Boolean2StackingConverter x:Key="Boolean2StackingConverter" />
        </Grid.Resources>
        <Grid.DataContext>
            <local:AggregateViewModel />
        </Grid.DataContext>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel MinHeight="48" Grid.Row="0" Orientation="Horizontal">
            <ComboBox x:Name="cbProperty" Margin="5" MinWidth="120" Height="24" ItemsSource="{Binding AggregateProperties}" DisplayMemberPath="Key" SelectedValuePath="Value"  SelectedIndex="0" SelectedValue="{Binding AggregateProperty}"/>
            <ComboBox x:Name="cbTopNCount" Margin="5" MinWidth="120" Height="24" ItemsSource="{Binding AggregateTypes}"  DisplayMemberPath="Key" SelectedValuePath="Value"  SelectedValue="{Binding AggregateType}" SelectedIndex="0"/>
        </StackPanel>

        <c1:C1FlexChart x:Name="flexChart1" Grid.Row="1"
                            Header="Sales data" BindingX="Key" LegendToggle="True"
                            ItemsSource="{Binding DataSource}">
            <c1:Series SeriesName="Value" Binding="Value"/>
        </c1:C1FlexChart>

    </Grid>
</UserControl>
