<UserControl x:Class="FlexGridSamples.Financial"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="using:FlexGridSamples"
             xmlns:c1="using:C1.Xaml.FlexGrid">
    <Grid>
        <Grid.Resources>
            <!--<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="*"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Vertical" Grid.ColumnSpan="2">
            <StackPanel Orientation="Horizontal" >
                <CheckBox x:Name="_chkOwnerDrawFinancial" Content="Custom Cells" IsChecked="True" Margin="0 0 10 0" VerticalAlignment="Center" Click="_chkOwnerDrawFinancial_Click"/>
                <CheckBox x:Name="_chkAutoUpdate" Content="Auto Update" IsChecked="True" Margin="0 0 10 0" VerticalAlignment="Center" Click="_chkAutoUpdate_Click"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 20">
                <TextBlock Text="Update Interval:" Margin="0 0 5 0" FontSize="16" VerticalAlignment="Center"/>
                <ComboBox x:Name="_cmbUpdateInterval" SelectedIndex="2" Width="100" VerticalAlignment="Center" SelectionChanged="_cmbUpdateInterval_SelectionChanged">
                    <ComboBoxItem Content="10 sec"/>
                    <ComboBoxItem Content="1 sec"/>
                    <ComboBoxItem Content="500 ms"/>
                </ComboBox>
                <TextBlock Text="Batch Size:" Margin="20 0 5 0" VerticalAlignment="Center" FontSize="16"/>
                <ComboBox x:Name="_cmbBatchSize" SelectedIndex="1" Width="100" Padding="5 5 0 5" VerticalAlignment="Center" SelectionChanged="_cmbBatchSize_SelectionChanged">
                    <ComboBoxItem Content="500 items"/>
                    <ComboBoxItem Content="100 items"/>
                    <ComboBoxItem Content="10 items"/>
                    <ComboBoxItem Content="1 item"/>
                </ComboBox>
                <TextBlock Text="Headers Visibility:" Margin="20 0 5 0" VerticalAlignment="Center" FontSize="16" Visibility="Collapsed"/>
                <ComboBox x:Name="_cmbHeadersVisibility" SelectedIndex="0" Width="100" Padding="5 5 0 5" VerticalAlignment="Center" SelectionChanged="_cmbHeadersVisibility_SelectionChanged" Visibility="Collapsed">
                    <ComboBoxItem Content="All"/>
                    <ComboBoxItem Content="Column"/>
                    <ComboBoxItem Content="Row"/>
                    <ComboBoxItem Content="None"/>
                </ComboBox>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Financial Info: " VerticalAlignment="Center"/>
                <TextBlock x:Name="_txtCompanies" Text="Companies" VerticalAlignment="Center"/>
            </StackPanel>
        </StackPanel>
        <local:SearchBox x:Name="_srchCompanies" VerticalAlignment="Top" HorizontalAlignment="Right" />
        <c1:C1FlexGrid x:Name="_flexFinancial"
                       Grid.Row="1" 
                       MinColumnWidth="10" 
                       MaxColumnWidth="300"
                       AutoGenerateColumns="False"
                       BorderThickness="1"
                       CellContentChanging="_flexFinancial_CellContentChanging">
            <c1:C1FlexGrid.Columns>
                <c1:Column Binding="{Binding Symbol}" Width="100"/>
                <c1:Column Binding="{Binding Name}" Width="250"/>
                <c1:Column Binding="{Binding Bid}" Width="150" Format="n2"/>
                <c1:Column Binding="{Binding Ask}" Width="150" Format="n2"/>
                <c1:Column Binding="{Binding LastSale}" Width="150" Format="n2"/>
                <c1:Column Binding="{Binding BidSize}" Width="100" Format="n0"/>
                <c1:Column Binding="{Binding AskSize}" Width="100" Format="n0"/>
                <c1:Column Binding="{Binding LastSize}" Width="100" Format="n0"/>
                <c1:Column Binding="{Binding Volume}" Width="100" Format="n0"/>
                <c1:Column Binding="{Binding QuoteTime}" Width="100" Format="hh:mm:ss"/>
                <c1:Column Binding="{Binding TradeTime}" Width="100" Format="hh:mm:ss"/>
            </c1:C1FlexGrid.Columns>
        </c1:C1FlexGrid>
    </Grid>
</UserControl>
