<Window x:Class="Printing.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Printing"
        Title="C1FlexGrid: Printing Support"
        WindowStartupLocation="CenterScreen"
        Height="350" Width="700">
    <Grid x:Name="LayoutRoot" Background="White">

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Vertical">
            <StackPanel Orientation="Horizontal" Margin="4">
                <TextBlock Text="Zoom: " VerticalAlignment="Center"/>
                <ComboBox x:Name="_cmbZoom" SelectedIndex="0" Width="100">
                    <ComboBoxItem Content="Actual Size" />
                    <ComboBoxItem Content="Page Width" />
                    <ComboBoxItem Content="Single Page" />
                </ComboBox>
                <TextBlock Text="    Margins: " VerticalAlignment="Center"/>
                <ComboBox x:Name="_cmbMargins" SelectedIndex="2" Width="80">
                    <ComboBoxItem Content="0.25 inch" />
                    <ComboBoxItem Content="0.5 inch" />
                    <ComboBoxItem Content="1 inch" />
                </ComboBox>
                <TextBlock Text="  Print: " VerticalAlignment="Center" />
                <Button Content="Basic..." Width="80" Click="_btnBasicPrint_Click" />
                <Button Content="Advanced..." Width="80" Click="_btnAdvancedPrint_Click" />
            </StackPanel >
            <StackPanel Orientation="Horizontal" Margin="4 0 4 4">
                <CheckBox x:Name="_chkGroup" Content="Group  " Click="_chkGroup_Click" />
                <CheckBox x:Name="_chkMerge" Content="Merge  " Click="_chkMerge_Click" />
                <CheckBox x:Name="_chkFreeze" Content="Freeze Panes  " Click="_chkFreeze_Click" />
            </StackPanel>
        </StackPanel>
        <c1:C1FlexGrid 
            x:Name="_flex" Grid.Row="1" 
            BorderThickness="1" BorderBrush="Black" ShowMarquee="True" IsReadOnly="True"
            AllowMerging="None" 
            AutoGenerateColumns="False">
            <c1:C1FlexGrid.Columns>
                <c1:Column Binding="{Binding Name}" />
                <c1:Column Binding="{Binding Line}" />
                <c1:Column Binding="{Binding Color}" />
                <c1:Column Binding="{Binding Price, StringFormat=n2}" HorizontalAlignment="Right" GroupAggregate="Average" />
                <c1:Column Binding="{Binding Weight, StringFormat=n2}" HorizontalAlignment="Right" GroupAggregate="Average" />
                <c1:Column Binding="{Binding Cost, StringFormat=n2}" HorizontalAlignment="Right" GroupAggregate="Average" />
                <c1:Column Binding="{Binding Volume, StringFormat=n2}" HorizontalAlignment="Right" GroupAggregate="Average" />
                <c1:Column Header="Rating" HorizontalAlignment="Right" Width="110" >
                    <c1:Column.CellTemplate>
                        <DataTemplate>
                            <local:RatingControl Rating="{Binding Rating}"/>
                        </DataTemplate>
                    </c1:Column.CellTemplate>
                </c1:Column>
                <c1:Column Binding="{Binding Discontinued}" />
            </c1:C1FlexGrid.Columns>

        </c1:C1FlexGrid>
    </Grid>
</Window>
