<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="FlexPrinting.MainPage" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="600" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:local="clr-namespace:FlexPrinting">

    <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="1" 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="None" />
                    <ComboBoxItem Content="0.5 inch" />
                    <ComboBoxItem Content="1 inch" />
                </ComboBox>
                <TextBlock Text="    Print: " VerticalAlignment="Center" />
                <Button Content="Basic..." Width="80" Click="_btnBasicPrinting_Click" />
                <Button Content="Advanced..." Width="80" Click="_btnAdvancedPrinting_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 Header="Name" Binding="{Binding Name}" />
                <c1:Column Header="Line" Binding="{Binding Line}" />
                <c1:Column Header="Color" Binding="{Binding Color}" />
                <c1:Column Header="Price" Binding="{Binding Price, StringFormat=n2}" HorizontalAlignment="Right" GroupAggregate="Average" />
                <c1:Column Header="Weight" Binding="{Binding Weight, StringFormat=n2}" HorizontalAlignment="Right" GroupAggregate="Average" />
                <c1:Column Header="Cost" Binding="{Binding Cost, StringFormat=n2}" HorizontalAlignment="Right" GroupAggregate="Average" />
                <c1:Column Header="Volume" 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, Mode=OneWay}" />
                        </DataTemplate>
                    </c1:Column.CellTemplate>
                </c1:Column>
                <c1:Column Binding="{Binding Discontinued}" />
            </c1:C1FlexGrid.Columns>
        </c1:C1FlexGrid>
    </Grid>
</UserControl>