<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="ColumnFilter.MainPage" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="700" FontFamily="Lucida Sans Unicode" FontSize="13" 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:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">

    <UserControl.Resources>
        <Style TargetType="Button">
            <Setter Property="Margin" Value="4 0" />
            <Setter Property="Padding" Value="8 2" />
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!-- header -->
        <TextBlock Text="C1FlexGrid: Column Filters" FontSize="16" FontWeight="Bold" />
        
        <!-- controls -->
        <StackPanel Orientation="Horizontal" Grid.Row="1">
            <Button Name="_btnClear" Content="Clear Filter" Click="_btnClear_Click" ToolTipService.ToolTip="Clear all filters currently applied to the columns." />
            <Button Name="_btnBlue" Content="Blue Color" Click="_btnBlue_Click" ToolTipService.ToolTip="Show only products with Color = Blue." />
            <Button Name="_btnExpensive" Content="Expensive Products" Click="_btnExpensive_Click" ToolTipService.ToolTip="Show only products that cost more than $900." />
            <Button Name="_btnSave" Content="Save Filter" Click="_btnSave_Click" ToolTipService.ToolTip="Save current filter definition as a string." />
            <Button Name="_btnLoad" Content="Load Filter" Click="_btnLoad_Click" ToolTipService.ToolTip="Restore previously saved filter definition." />
            <CheckBox Name="_chkCollectionView" Content="UseCollectionView" VerticalAlignment="Center" Click="_chkCollectionView_Click" ToolTipService.ToolTip="Apply filter to source collection (instead of setting row visibility)." />
        </StackPanel>

        <!-- C1FlexGrid -->
        <c1:C1FlexGrid x:Name="_flex" Grid.Row="2">

            <!-- use C1FlexGridFilterService to add the filter -->
            <c1:C1FlexGridFilterService.FlexGridFilter>
                <c1:C1FlexGridFilter FilterApplied="C1FlexGridFilter_FilterApplied" />
            </c1:C1FlexGridFilterService.FlexGridFilter>
        </c1:C1FlexGrid>
        
        <!-- status bar -->
        <TextBlock Name="_txtStatus" Grid.Row="3" HorizontalAlignment="Right" />
    </Grid>
</UserControl>