<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="CollectionViewDemo2010.MainPage" mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1024" 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:local="clr-namespace:CollectionViewDemo2010" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
    <UserControl.Resources>

    </UserControl.Resources>
    <Border>
        <Border.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFF2F5F9" Offset="0" />
                <GradientStop Color="#FFB4CFE4" Offset="1" />
            </LinearGradientBrush>
        </Border.Background>
        <Grid x:Name="LayoutRoot" Margin="40">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <StackPanel Orientation="Vertical">
                <TextBlock Text="C1CollectionView " Foreground="#FF2B4C66" FontSize="32" Margin="0,-10,0,0" />
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Border Width="4" Background="#FF2B4C66" Margin="0 0 10 0" />
                    <TextBlock Grid.Column="1" TextWrapping="Wrap" Margin=" 0 8">
                    This sample demonstrates C1CollectionView performance benefits over native CollectionView. You may change 
                    a number of items in data source, define properties to sort and group on, then press the "Run tests" button and compare
                    times necessary to apply these view conditions to the native and ComponentOne collection views.
                    </TextBlock>
                </Grid>

                <Grid Margin="0 16 0 0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="40" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="40" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="40" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="Items count:" />
                        <c1:C1NumericBox Height="36" VerticalAlignment="Stretch" Name="rowCountNB" Value="20000" Maximum="50000" Minimum="100" Increment="1000" CornerRadius="0" BorderBrush="#FF2B4C66" ButtonForeground="White">
                        	<c1:C1NumericBox.ButtonBackground>
                        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        			<GradientStop Color="#FF2B4C66" Offset="0" />
                        		</LinearGradientBrush>
                        	</c1:C1NumericBox.ButtonBackground>
                        </c1:C1NumericBox>
                    </StackPanel>
                    
                    <local:ChooseItemsControl Grid.Column="2" Grid.ColumnSpan="3" x:Name="sortGroupFields" MinHeight="60" />

                    <Button Name="runButton" Grid.Column="6" Content="Run tests" Click="runButton_Click" Height="36" VerticalAlignment="Bottom" FontSize="14" />
                </Grid>

                <Border Height="2" Margin="0 16">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFB4CFE4" Offset="0.5" />
                            <GradientStop Color="#FFFFFFFF" Offset="0.5" />
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>

            </StackPanel>
            
            <Grid Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="40" />
                    <ColumnDefinition />
                    <ColumnDefinition Width="40" />
                    <ColumnDefinition />
                    <ColumnDefinition Width="40" />
                    <ColumnDefinition />
                 </Grid.ColumnDefinitions>
                <TextBlock Grid.ColumnSpan="2" Text="Native CollectionView time:" VerticalAlignment="Center" Foreground="#FF2B4C66" FontWeight="Bold" FontSize="13" TextWrapping="Wrap" />
                <Border Grid.Column="2" Background="White" Height="36">
                    <StackPanel Orientation="Horizontal" Margin="10 2" HorizontalAlignment="Right">
                        <TextBlock Name="msTimeTextBlock" FontSize="32" FontWeight="Light" Foreground="#FF2B4C66" VerticalAlignment="Bottom" Margin="0 0 0 -7" />
                        <TextBlock Text="sec" FontSize="18" FontWeight="Light" Foreground="#FF2B4C66" VerticalAlignment="Bottom" Margin="5 0 0 -2" />
                    </StackPanel>
                </Border>

                <TextBlock Grid.Column="4" Grid.ColumnSpan="2" Text="ComponentOne CollectionView time:" VerticalAlignment="Center" Foreground="#FF2B4C66" FontWeight="Bold" FontSize="13" TextWrapping="Wrap" />
                <Border Grid.Column="6" Background="White" Height="36">
                    <StackPanel Orientation="Horizontal" Margin="10 2" HorizontalAlignment="Right">
                        <TextBlock Name="c1TimeTextBlock" FontSize="32" FontWeight="Light" Foreground="#FF2B4C66" VerticalAlignment="Bottom" Margin="0 0 0 -7" />
                        <TextBlock Text="sec" FontSize="18" FontWeight="Light" Foreground="#FF2B4C66" VerticalAlignment="Bottom" Margin="5 0 0 -2" />
                    </StackPanel>
                </Border>
                

            <TextBlock Name="cmpTextBlock" Grid.Column="4" Grid.ColumnSpan="3" TextAlignment="Left" Foreground="#FFFF7612" FontWeight="Bold" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0 -16 0 0" />
            <sdk:DataGrid Name="dataGridMS" Grid.Row="2" Grid.ColumnSpan="3" AutoGenerateColumns="True" Margin="0 15 0 0" />
            <sdk:DataGrid Name="dataGridC1" Grid.Row="2" Grid.Column="4" Grid.ColumnSpan="3" AutoGenerateColumns="True" Margin="0 15 0 0" />
        </Grid>
        </Grid>
    </Border>
</UserControl>