<UserControl x:Class="MainTestApplication.Performance"
    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:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
    <Grid>
        <!-- Styles that are used in the controls of this application-->
        <Grid.Resources>
            <Style x:Key="gridStyle" TargetType="Control" >
                <Setter Property="Margin" Value="8" />
                <Setter Property="BorderBrush" Value="#FFA3AEB9" />
                <Setter Property="BorderThickness" Value="1" />
            </Style>
            <Style x:Key="textBorderStyle" TargetType="Border" >
                <Setter Property="Margin" Value="8" />
                <Setter Property="BorderBrush" Value="#FFA3AEB9" />
                <Setter Property="BorderThickness" Value="1" />
            </Style>
            <Style x:Key="excelBlue" TargetType="c1:C1FlexGrid">
                <Setter Property="Margin" Value="8" />
                <Setter Property="BorderBrush" Value="#FFA3AEB9" />
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="GridLinesVisibility" Value="All" />
                <Setter Property="ShowMarquee" Value="True" />
                <Setter Property="RowBackground" Value="Transparent" />
                <Setter Property="AlternatingRowBackground" Value="Transparent" />
                <Setter Property="CursorBackground" Value="Transparent" />
                <Setter Property="EditorBackground" Value="Transparent" />
                <Setter Property="TopLeftCellBackground" Value="#FFA9C4E9" />
                <Setter Property="RowHeaderBackground" Value="#FFE4ECF7" />
                <Setter Property="RowHeaderSelectedBackground" Value="#FFFFD58D" />
                <Setter Property="GridLinesBrush" Value="#FFD0D7E5" />
                <Setter Property="HeaderGridLinesBrush" Value="#FF9EB6CE" />
                <Setter Property="SelectionBackground" Value="#FFEAECF5" />
                <Setter Property="ColumnHeaderSelectedBackground" >
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0,1">
                            <GradientStop Color="#FFF8D79B" Offset="0" />
                            <GradientStop Color="#FFF1C263" Offset="1" />
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="ColumnHeaderBackground" >
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0,1">
                            <GradientStop Color="#FFF6FAFB" Offset="0" />
                            <GradientStop Color="#FFD5DDEA" Offset="1" />
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Margin="5">
            <TextBlock Text="Number of data columns: " VerticalAlignment="Center" />
            <ComboBox x:Name="_cmbColumns" Width="60" SelectionChanged="_cmbColumns_SelectionChanged">
                <ComboBoxItem Content="1" />
                <ComboBoxItem Content="5" />
                <ComboBoxItem Content="10" />
                <ComboBoxItem Content="50" />
                <ComboBoxItem Content="100" />
                <ComboBoxItem Content="500" />
                <ComboBoxItem Content="1000" />
            </ComboBox>
        </StackPanel>
        <Grid Grid.Row="1" Grid.Column="0" Margin="5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" TextWrapping="Wrap" VerticalAlignment="Center" Text="DataGrid for Standard Silverlight" />
            <Button Grid.Column="1" x:Name="_btnDgBind" Content="Consolidate data" Click="_btnDgBind_Click"/>
            <Button Grid.Column="1" x:Name="_btnDgClear" Content="Initialize" Click="_btnDgClear_Click" Visibility="Collapsed"/>
            <Border Grid.Column="2" BorderBrush="#FFA3AEB9" Background="#FFF4F6F9" BorderThickness="1" Margin="5 0" >
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Second: "  Margin="5,2" Foreground="#FF4976AD" HorizontalAlignment="Right"/>
                    <TextBlock x:Name="_tbDgTime" Text="0.00"  Margin="5,2" Foreground="#FF4976AD" HorizontalAlignment="Right"/>
                </StackPanel>
            </Border>
        </Grid>
        <Grid Grid.Row="1" Grid.Column="1" Margin="5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" TextWrapping="Wrap" Text="FlexGrid for Silverlight" />
            <Button Grid.Column="1" x:Name="_btnFgBind" Content="Consolidate data" Click="_btnFgBind_Click"/>
            <Button Grid.Column="1" x:Name="_btnFgClear" Content="Initialize" Click="_btnFgClear_Click" Visibility="Collapsed"/>
            <Border Grid.Column="2" BorderBrush="#FFA3AEB9" Background="#FFF4F6F9" BorderThickness="1" Margin="5 0" >
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Second: "  Margin="5,2" Foreground="#FF4976AD" HorizontalAlignment="Right"/>
                    <TextBlock x:Name="_tbFgTime" Text="0.00"  Margin="5,2" Foreground="#FF4976AD" HorizontalAlignment="Right"/>
                </StackPanel>

            </Border>
        </Grid>
        <sdk:DataGrid x:Name="_datagridPerformance" Grid.Row="2" Grid.Column="0"
                                Style="{StaticResource gridStyle}"
                                ColumnWidth="180"
                                RowHeight="24"
                                ColumnHeaderHeight="24"
                                MinColumnWidth="180"
                                MaxColumnWidth="300" BorderThickness="1"
                                          AutoGenerateColumns="False"/>
        <c1:C1FlexGrid x:Name="_flexPerformance" Grid.Row="2" Grid.Column="1"
                                Style="{StaticResource gridStyle}"
                                AllowMerging="All"
                                MinColumnWidth="180"
                                MaxColumnWidth="300" BorderThickness="1" AutoGenerateColumns="False"/>
    </Grid>
</UserControl>
