	  
	   
    
		

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:extended="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:c1="clr-namespace:C1.WPF;assembly=C1.WPF.4" xmlns:c1datetime="clr-namespace:C1.WPF.DateTimeEditors;assembly=C1.WPF.DateTimeEditors.4" xmlns:c1DataGrid="clr-namespace:C1.WPF.DataGrid">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1Button.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1ScrollBar.xaml" />
        <ResourceDictionary Source="/C1.WPF.DataGrid.4;component/themes/Common.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- ******************** Filters ********************-->

    <!-- DataGridFilter Style -->
    <Style TargetType="c1DataGrid:DataGridFilter">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:DataGridFilter">
                    <Grid x:Name="filter_text" VerticalAlignment="Stretch">
                        <c1:C1BrushBuilder x:Name="BackgroundBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource DataGridFilterBrush}" DesignColor="{StaticResource BaseColor}" />
                        <!--<c1:C1BrushBuilder x:Name="FilterContentBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource DataGridFilterContentBrush}" DesignColor="{StaticResource BaseColor}"/>-->
                        <Border x:Name="BackgroundElement" Background="{Binding Output, ElementName=BackgroundBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{StaticResource DataGridBorderThickness}" CornerRadius="{StaticResource DataGridFilterCornerRadius}" />
                        <Grid Margin="6">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <!--<Border Background="{Binding Output, ElementName=FilterContentBrush}" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{StaticResource DataGridFilterCornerRadius}"/>-->
                            <ContentControl x:Name="InnerControlContainer" MaxHeight="200" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" IsTabStop="False" />
                            <Grid Grid.Row="2" HorizontalAlignment="Right">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Button x:Name="FilterButton" HorizontalAlignment="Center" MinWidth="77" Margin="0 0 5 0" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="{StaticResource GeneralCornerRadius}" Style="{StaticResource ClearStyleButtonStyle}">
                                    <TextBlock Text="{Binding Path=Filter_Filter, Source={StaticResource DataGridResources}}" TextTrimming="WordEllipsis" />
                                </Button>
                                <Button x:Name="ClearButton" HorizontalAlignment="Center" Grid.Column="1" MinWidth="77" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.CornerRadius="{StaticResource GeneralCornerRadius}" Style="{StaticResource ClearStyleButtonStyle}">
                                    <TextBlock Text="{Binding Path=Filter_Clear, Source={StaticResource DataGridResources}}" TextTrimming="WordEllipsis" />
                                </Button>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- DataGridTextFilter Style -->
    <Style TargetType="c1DataGrid:DataGridTextFilter">
        
        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputDataGridBorderBrush}" />
        <Setter Property="InputBackground" Value="{StaticResource DataGridRowBrush}" />
        <Setter Property="InputForeground" Value="{StaticResource DataGridRowForeground}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:DataGridTextFilter">
                    <Grid Margin="6" x:Name="filter_text">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="110" />
                            <ColumnDefinition Width="6" />
                            <ColumnDefinition Width="Auto" MinWidth="95" />
                        </Grid.ColumnDefinitions>
                        <c1:C1ComboBox x:Name="FilterOperation" Background="{TemplateBinding InputBackground}" Foreground="{TemplateBinding InputForeground}" ButtonBackground="{TemplateBinding Background}" ButtonForeground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" SelectedBackground="{TemplateBinding SelectedBackground}" FocusBrush="{TemplateBinding FocusBrush}" />
                        <c1:C1TextBoxBase x:Name="FilterBox" Grid.Column="2" Background="{TemplateBinding InputBackground}" Foreground="{TemplateBinding InputForeground}" BorderBrush="{TemplateBinding BorderBrush}" MouseOverBrush="{TemplateBinding MouseOverBrush}" FocusBrush="{TemplateBinding FocusBrush}" MaxWidth="100" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- DataGridNumericFilter Style -->
    <Style TargetType="c1DataGrid:DataGridNumericFilter">
        
        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputDataGridBorderBrush}" />
        <Setter Property="InputBackground" Value="{StaticResource DataGridRowBrush}" />
        <Setter Property="InputForeground" Value="{StaticResource DataGridRowForeground}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:DataGridNumericFilter">
                    <Grid x:Name="filter_text" Margin="6">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="110" />
                            <ColumnDefinition Width="6" />
                            <ColumnDefinition Width="Auto" MinWidth="50" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <c1:C1ComboBox x:Name="FirstComparator" Background="{TemplateBinding InputBackground}" Foreground="{TemplateBinding InputForeground}" ButtonBackground="{TemplateBinding Background}" ButtonForeground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" SelectedBackground="{TemplateBinding SelectedBackground}" FocusBrush="{TemplateBinding FocusBrush}" />
                        <c1:C1ComboBox x:Name="SecondComparator" Grid.Row="2" IsEnabled="False" Background="{TemplateBinding InputBackground}" Foreground="{TemplateBinding InputForeground}" ButtonBackground="{TemplateBinding Background}" ButtonForeground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" SelectedBackground="{TemplateBinding SelectedBackground}" FocusBrush="{TemplateBinding FocusBrush}" />
                        <c1:C1NumericBox x:Name="FirstBound" Grid.Column="2" Background="{TemplateBinding InputBackground}" Foreground="{TemplateBinding InputForeground}" BorderBrush="{TemplateBinding BorderBrush}" ButtonBackground="{TemplateBinding Background}" ButtonForeground="{TemplateBinding Foreground}" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" FocusBrush="{TemplateBinding FocusBrush}" />
                        <c1:C1NumericBox x:Name="SecondBound" Grid.Column="2" Grid.Row="2" IsEnabled="False" Background="{TemplateBinding InputBackground}" Foreground="{TemplateBinding InputForeground}" BorderBrush="{TemplateBinding BorderBrush}" ButtonBackground="{TemplateBinding Background}" ButtonForeground="{TemplateBinding Foreground}" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" FocusBrush="{TemplateBinding FocusBrush}" />
                        <Grid HorizontalAlignment="Left" Grid.Row="1" Grid.ColumnSpan="3" Margin="4">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <RadioButton x:Name="NoneRadioButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Foreground="{TemplateBinding Foreground}">
                                <TextBlock Text="{Binding NumericFilter_None, Source={StaticResource DataGridResources}}" TextTrimming="WordEllipsis" />
                            </RadioButton>
                            <RadioButton x:Name="OrRadioButton" Margin="4,0,0,0" Grid.Column="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Foreground="{TemplateBinding Foreground}">
                                <TextBlock Text="{Binding NumericFilter_Or, Source={StaticResource DataGridResources}}" TextTrimming="WordEllipsis" />
                            </RadioButton>
                            <RadioButton x:Name="AndRadioButton" Margin="4,0,0,0" Grid.Column="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Foreground="{TemplateBinding Foreground}">
                                <TextBlock Text="{Binding NumericFilter_And, Source={StaticResource DataGridResources}}" TextTrimming="WordEllipsis" />
                            </RadioButton>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- DataGridCheckBoxFilter Style -->
    <Style TargetType="c1DataGrid:DataGridCheckBoxFilter">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:DataGridCheckBoxFilter">
                    <Grid Margin="6">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="6" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="FilterLabel" Text="{Binding CheckBoxFilter_Checked, Source={StaticResource DataGridResources}}" Foreground="{TemplateBinding Foreground}" TextTrimming="WordEllipsis" />
                        <CheckBox x:Name="FilterCheckBox" Grid.Column="2" VerticalAlignment="Center" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Multi-value filter-->
    <Style TargetType="c1DataGrid:DataGridMultiValueFilter">
        
        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputDataGridBorderBrush}" />
        <Setter Property="InputBackground" Value="{StaticResource DataGridRowBrush}" />
        <Setter Property="InputForeground" Value="{StaticResource DataGridRowForeground}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="ItemStyle">
            <Setter.Value>
                <Style TargetType="ToggleButton">
                    <Setter Property="Margin" Value="4" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:DataGridMultiValueFilter">
                    <Grid Margin="6" MinWidth="158">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <CheckBox x:Name="FilterAllCheckBox" Margin="5 4 4 4" VerticalAlignment="Center" Grid.Column="2" IsThreeState="True" IsChecked="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Foreground="{TemplateBinding Foreground}">
                            <TextBlock Text="{Binding ComboBoxFilter_SelectAll, Source={StaticResource DataGridResources}}" TextTrimming="WordEllipsis" />
                        </CheckBox>
                        <ScrollViewer x:Name="ScrollViewer" Grid.Row="2" Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden" Background="{TemplateBinding InputBackground}" Foreground="{TemplateBinding InputForeground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" c1:ClearStyleExtensions.ButtonBackground="{TemplateBinding Background}" c1:ClearStyleExtensions.ButtonForeground="{TemplateBinding Foreground}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" Style="{StaticResource ScrollViewerClearStyle}" IsTabStop="False">
                            <ItemsPresenter />
                            <c1:ScrollViewerTouchBehavior.TouchBehavior>
                                <c1:ScrollViewerTouchBehavior />
                            </c1:ScrollViewerTouchBehavior.TouchBehavior>
                        </ScrollViewer>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- DataGridDateTimeFilter Style -->
    <Style TargetType="c1DataGrid:DataGridDateTimeFilter">
      
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputDataGridBorderBrush}" />
        <Setter Property="InputBackground" Value="{StaticResource DataGridRowBrush}" />
        <Setter Property="InputForeground" Value="{StaticResource DataGridRowForeground}" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1DataGrid:DataGridDateTimeFilter">
                    <Grid x:Name="filter_text" Margin="6">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="5" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="5" />
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <TextBlock x:Name="StartDateLabel" VerticalAlignment="Center" Text="{Binding DateTimeFilter_Start, Source={StaticResource DataGridResources}}" TextTrimming="WordEllipsis" />
                        <TextBlock x:Name="EndDateLabel" VerticalAlignment="Center" Text="{Binding DateTimeFilter_End, Source={StaticResource DataGridResources}}" Grid.Row="2" TextTrimming="WordEllipsis" />

                        <c1datetime:C1DateTimePicker x:Name="StartDateTime" Padding="0" AllowNull="True" VerticalAlignment="Center" Grid.Column="2" Background="{TemplateBinding InputBackground}" Foreground="{TemplateBinding InputForeground}" ButtonBackground="{TemplateBinding Background}" ButtonForeground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" FocusBrush="{TemplateBinding FocusBrush}" />
                        <c1datetime:C1DateTimePicker x:Name="EndDateTime" Padding="0" AllowNull="True" VerticalAlignment="Center" Grid.Column="2" Grid.Row="2" Background="{TemplateBinding InputBackground}" Foreground="{TemplateBinding InputForeground}" ButtonBackground="{TemplateBinding Background}" ButtonForeground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" FocusBrush="{TemplateBinding FocusBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
