<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                    mc:Ignorable="d">

    <Style x:Key="FilterPanelCheckBox" TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
        <Setter Property="Margin" Value="8,2,6,8" />
        <Style.Triggers>
            <Trigger Property="IsChecked" Value="{StaticResource False}">
                <Setter Property="Opacity" Value="1.0" />
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style x:Key="FilterPanelLabel" TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
        <Setter Property="Margin" Value="8,10,6,4" />
        <Style.Triggers>
            <Trigger Property="Tag" Value="{StaticResource False}">
                <Setter Property="Opacity" Value="0.5"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style x:Key="FilterPanelFilterSearchBox" TargetType="SearchBox" BasedOn="{StaticResource {x:Type SearchBox}}">
        <Setter Property="Margin" Value="8,0,6,0" />
        <Setter Property="ShowImage" Value="False" />
    </Style>
    
    <Style x:Key="FilterPanelFilterSelectionBox" TargetType="FilterSelectionBox" BasedOn="{StaticResource {x:Type FilterSelectionBox}}">
        <Setter Property="Margin" Value="8,0,6,0" />
    </Style>
    
    <Style x:Key="FilterPanelFilterEnumSelectionBox" TargetType="FilterEnumSelectionBox" BasedOn="{StaticResource {x:Type FilterEnumSelectionBox}}">
        <Setter Property="Margin" Value="8,0,6,0" />
    </Style>
    
    <Style x:Key="FilterPanelFilterStringSelectionBox" TargetType="FilterStringSelectionBox" BasedOn="{StaticResource {x:Type FilterStringSelectionBox}}">
        <Setter Property="Margin" Value="8,0,6,0" />
    </Style>

    <Style x:Key="FilterPresetButtonAction" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
        <Setter Property="FontFamily" Value="{StaticResource FontIcoFont}" />
        <Setter Property="Padding" Value="5" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="DockPanel.Dock" Value="Right" />
    </Style>

    <Style TargetType="{x:Type FilterPanel}">  
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type FilterPanel}">
                    <Border BorderBrush="{DynamicResource PanelSeparatorBrush}"
                            Background="{DynamicResource FilterPanelViewBackgroundBrush}"
                            d:DesignWidth="200">
                        <Border.Style>
                            <Style TargetType="Border">
                                <Setter Property="BorderThickness" Value="2.5,0,0,0" />
                                <Style.Triggers>                                    
                                    <DataTrigger Binding="{Settings FilterPanelPosition}" Value="Left">
                                        <Setter Property="BorderThickness" Value="0,0,2.5,0" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Settings ShowPanelSeparators}" Value="False">
                                        <Setter Property="BorderThickness" Value="0" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                        <DockPanel Background="{TemplateBinding Background}">
                            <DockPanel Margin="10,8,5,5" DockPanel.Dock="Top">
                                <Button Content="r" FontFamily="Marlett"
                                        Style="{StaticResource SimpleButton}"
                                        DockPanel.Dock="Right" Margin="0,0,5,0"
                                        Name="PART_ButtonClose"/>
                                <Button DockPanel.Dock="Left" Content="{StaticResource LOCClearFilters}"                                        
                                        HorizontalAlignment="Left"
                                        Style="{StaticResource SimpleButton}"
                                        Name="PART_ButtonClear"/>
                            </DockPanel>
                            <DockPanel DockPanel.Dock="Top" Margin="8,0,6,5">
                                <Button x:Name="PART_ButtonDeleteFilter"
                                        Content="&#xec53;" Style="{DynamicResource FilterPresetButtonAction}" />
                                <Button x:Name="PART_ButtonRenameFilter"
                                        Content="&#xec55;" Style="{DynamicResource FilterPresetButtonAction}"/>
                                <Button x:Name="PART_ButtonSaveFilter"
                                        Content="&#xee00;" Style="{DynamicResource FilterPresetButtonAction}" />
                                <ComboBox x:Name="PART_ComboFilterPresets"
                                          DockPanel.Dock="Left" VerticalAlignment="Center" />
                            </DockPanel>                            
                            <ScrollViewer Margin="0,15,0,0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"
                                      DockPanel.Dock="Top" Padding="0,0,0,15">
                                <StackPanel x:Name="PART_PanelItemsHost" />
                            </ScrollViewer>
                        </DockPanel>
                    </Border>                                                       
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>