<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 TargetType="{x:Type FilterPanel}">  
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type FilterPanel}">
                    <Border BorderBrush="{DynamicResource PanelSeparatorBrush}"
                            d:DesignWidth="200">
                        <Border.Style>
                            <Style TargetType="Border">
                                <Setter Property="BorderThickness" Value="1,0,0,0" />
                                <Style.Triggers>                                    
                                    <DataTrigger Binding="{Settings FilterPanelPosition}" Value="Left">
                                        <Setter Property="BorderThickness" Value="0,0,1,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,12" 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>
                            <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"
                                      DockPanel.Dock="Top" Padding="0,0,0,15">
                                <StackPanel>
                                    <StackPanel.Resources>
                                        <Style x:Key="FilterCheck" 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="0.6" />
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                        <Style x:Key="FilterLabel" 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.6"/>
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                        <Style TargetType="SearchBox">
                                            <Setter Property="Margin" Value="8,0,6,0" />
                                            <Setter Property="ShowImage" Value="False" />
                                        </Style>
                                        <Style TargetType="FilterSelectionBox">
                                            <Setter Property="Margin" Value="8,0,6,0" />
                                        </Style>
                                        <Style TargetType="FilterEnumSelectionBox">
                                            <Setter Property="Margin" Value="8,0,6,0" />
                                        </Style>
                                        <Style TargetType="FilterStringSelectionBox">
                                            <Setter Property="Margin" Value="8,0,6,0" />
                                        </Style>
                                    </StackPanel.Resources>

                                    <CheckBox Name="PART_ToggleInstalled" Style="{StaticResource FilterCheck}">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{StaticResource LOCGameIsInstalledTitle}" Margin="0,0,5,0" />
                                            <ContentControl Name="PART_ContentInstalledCount" ContentStringFormat="({0})"/>
                                        </StackPanel>
                                    </CheckBox>

                                    <CheckBox Name="PART_ToggleUnInstalled" Style="{StaticResource FilterCheck}">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{StaticResource LOCGameIsUnInstalledTitle}" Margin="0,0,5,0" />
                                            <ContentControl Name="PART_ContentUnInstalledCount" ContentStringFormat="({0})"/>
                                        </StackPanel>
                                    </CheckBox>

                                    <CheckBox Name="PART_ToggleHidden" Style="{StaticResource FilterCheck}">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{StaticResource LOCGameHiddenTitle}" Margin="0,0,5,0" />
                                            <ContentControl Name="PART_ContentHiddenCount" ContentStringFormat="({0})"/>
                                        </StackPanel>
                                    </CheckBox>

                                    <CheckBox Name="PART_ToggleFavorite" Style="{StaticResource FilterCheck}">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{StaticResource LOCGameFavoriteTitle}" Margin="0,0,5,0" />
                                            <ContentControl Name="PART_ContentFavoriteCount" ContentStringFormat="({0})"/>
                                        </StackPanel>
                                    </CheckBox>

                                    <!--Platform-->
                                    <Label Name="PART_ElemPlatformLabel" Content="{StaticResource LOCPlatformTitle}"
                                       Style="{StaticResource FilterLabel}"/>
                                    <FilterSelectionBox x:Name="PART_FilterPlatform" />

                                    <!--Library-->
                                    <Label Name="PART_ElemLibraryLabel" Content="{StaticResource LOCLibrary}" 
                                       Style="{StaticResource FilterLabel}" />
                                    <FilterSelectionBox x:Name="PART_FilterLibrary" />

                                    <!--Name-->
                                    <Label Name="PART_ElemNameLabel" Content="{StaticResource LOCNameLabel}"
                                       Style="{StaticResource FilterLabel}" />
                                    <SearchBox x:Name="PART_FilterName" />

                                    <!--Genre-->
                                    <Label Name="PART_ElemGenreLabel" Content="{StaticResource LOCGenreLabel}"
                                       Style="{StaticResource FilterLabel}"/>
                                    <FilterSelectionBox x:Name="PART_FilterGenre" />

                                    <!--ReleaseYear-->
                                    <Label Name="PART_ElemReleaseYearLabel" Content="{StaticResource LOCGameReleaseYearTitle}"
                                       Style="{StaticResource FilterLabel}"/>
                                    <FilterStringSelectionBox x:Name="PART_FilterReleaseYear" />

                                    <!--Developer-->
                                    <Label Name="PART_ElemDeveloperLabel" Content="{StaticResource LOCDeveloperLabel}"
                                       Style="{StaticResource FilterLabel}"/>
                                    <FilterSelectionBox x:Name="PART_FilterDeveloper" />

                                    <!--Publisher-->
                                    <Label Name="PART_ElemPublisherLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCPublisherLabel}" />
                                    <FilterSelectionBox x:Name="PART_FilterPublisher" />

                                    <!--Category-->
                                    <Label Name="PART_ElemCategoryLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCCategoryLabel}" />
                                    <FilterSelectionBox x:Name="PART_FilterCategory" />

                                    <!--Tag-->
                                    <Label Name="PART_ElemTagLabel" Style="{StaticResource FilterLabel}" 
                                       Content="{DynamicResource LOCTagLabel}" />
                                    <FilterSelectionBox x:Name="PART_FilterTag" />

                                    <!--PlayTime-->
                                    <Label Name="PART_ElemPlayTimeLabel" Style="{StaticResource FilterLabel}" 
                                       Content="{DynamicResource LOCTimePlayed}" />
                                    <FilterEnumSelectionBox x:Name="PART_FilterPlayTime" />

                                    <!--CompletionStatus-->
                                    <Label Name="PART_ElemCompletionStatusLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCCompletionStatus}" />
                                    <FilterEnumSelectionBox x:Name="PART_FilterCompletionStatus" />

                                    <!--Series-->
                                    <Label Name="PART_ElemSeriesLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCSeriesLabel}" />
                                    <FilterSelectionBox x:Name="PART_FilterSeries" />

                                    <!--Region-->
                                    <Label Name="PART_ElemRegionLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCRegionLabel}" />
                                    <FilterSelectionBox x:Name="PART_FilterRegion" />

                                    <!--Source-->
                                    <Label Name="PART_ElemSourceLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCSourceLabel}"/>
                                    <FilterSelectionBox x:Name="PART_FilterSource" />

                                    <!--AgeRating-->
                                    <Label Name="PART_ElemAgeRatingLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCAgeRatingLabel}" />
                                    <FilterSelectionBox x:Name="PART_FilterAgeRating" />

                                    <!--Version-->
                                    <Label Name="PART_ElemVersionLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCVersionLabel}" />
                                    <SearchBox x:Name="PART_FilterVersion" />

                                    <!--UserScore-->
                                    <Label Name="PART_ElemUserScoreLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCUserScore}" />
                                    <FilterEnumSelectionBox x:Name="PART_FilterUserScore" />

                                    <!--CommunityScore-->
                                    <Label Name="PART_ElemCommunityScoreLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCCommunityScore}" />
                                    <FilterEnumSelectionBox x:Name="PART_FilterCommunityScore" />

                                    <!--CriticScore-->
                                    <Label Name="PART_ElemCriticScoreLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCCriticScore}" />
                                    <FilterEnumSelectionBox x:Name="PART_FilterCriticScore" />

                                    <!--LastActivity-->
                                    <Label Name="PART_ElemLastActivityLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCGameLastActivityTitle}" />
                                    <FilterEnumSelectionBox x:Name="PART_FilterLastActivity" />

                                    <!--Added-->
                                    <Label Name="PART_ElemAddedLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCDateAddedLabel}" />
                                    <FilterEnumSelectionBox x:Name="PART_FilterAdded" />

                                    <!--Modified-->
                                    <Label Name="PART_ElemModifiedLabel" Style="{StaticResource FilterLabel}"
                                       Content="{DynamicResource LOCDateModifiedLabel}" />
                                    <FilterEnumSelectionBox x:Name="PART_FilterModified" />
                                </StackPanel>
                            </ScrollViewer>
                        </DockPanel>
                    </Border>                                                       
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>