<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:local="clr-namespace:CustomThemeBasedOnOfficeBlack_GridWpf;assembly=CustomThemeBasedOnOfficeBlack_GridWpf"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
  
    xmlns:grid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
        xmlns:controls="clr-namespace:Telerik.Windows.Controls"
	
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Resources.xaml"/>
        <ResourceDictionary Source="GridViewScrollViewer_x.xaml"/>
    </ResourceDictionary.MergedDictionaries>

	<!-- Style for TextBox -->
	<Style x:Key="TextBoxStyle" TargetType="TextBox">
		<Setter Property="Foreground" Value="{StaticResource DistingtFilterTextBoxForegound}"/>
		<Setter Property="Background" Value="{StaticResource DistingtFilterTextBoxBackground}"/>
		<Setter Property="BorderBrush" Value="{StaticResource DistinctFilterTextBoxBorderBrush}"/>
		<Setter Property="BorderThickness" Value="1,1,1,1"/>
		<Setter Property="Padding" Value="1"/>
		
		<Setter Property="AllowDrop" Value="True"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="TextBox">
					
					<Border x:Name="TextBoxBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
						<ScrollViewer x:Name="PART_ContentHost" />
					</Border>				
					<ControlTemplate.Triggers>
						<Trigger Property="IsFocused" Value="True">
							<Setter TargetName="TextBoxBorder" Property="BorderBrush" Value="{StaticResource DistinctFilterTextBoxBorder_Over}" />
						</Trigger>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="TextBoxBorder" Property="BorderBrush" Value="{StaticResource DistinctFilterTextBoxBorder_Over}" />
						</Trigger>
					</ControlTemplate.Triggers>
					
					
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Style for CheckBox -->
    <Style TargetType="CheckBox" x:Key="CheckBoxItem">
        <Setter Property="Background" Value="{StaticResource DistinctFilterCheckBoxBackground}"/>
        <Setter Property="Foreground" Value="{StaticResource DistinctFilterCheckBoxForeground}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="Padding" Value="4,1,0,0"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource DistinctFilterCheckBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="16"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Rectangle x:Name="Background" Width="14" Height="14" RadiusX="0" RadiusY="0" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Fill="{TemplateBinding Background}" Margin="1"/>
                            <Rectangle x:Name="BoxMiddle" Width="10" Height="10" RadiusX="0" RadiusY="0" StrokeThickness="1" Stroke="{StaticResource DistinctFilterCheckboxStroke}" Fill="{StaticResource DistinctFilterCheckboxFill}"  />
                            <Rectangle x:Name="BoxMiddleLine" Width="10" Height="10" RadiusX="0" RadiusY="0" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" Opacity=".2"/>

                            <Path x:Name="CheckIcon" Margin="0,1,0,1.5" Stretch="Fill" Opacity="0" Width="9" Height="8" Stroke="{StaticResource DistinctFilterCheckBoxCheckIcon}" StrokeThickness="2" Data="M32.192282,77.371554 L34.688632,80.304322 38.863374,72.720928"/>
                            <Rectangle x:Name="IndeterminateIcon" Height="2" Fill="{StaticResource DistinctFilterCheckBoxCheckIcon}" Opacity="0" Width="6"/>
                            <Rectangle x:Name="DisabledVisualElement" RadiusX="0" RadiusY="0" Width="14" Height="14" Opacity="0" Fill="{StaticResource DistinctFilterCheckBoxDisabledBrush}"/>
                            <Rectangle x:Name="ContentFocusVisualElement" RadiusX="0" RadiusY="0" Stroke="{StaticResource DistinctFilterCheckBoxFocusedBrush}" StrokeThickness="0" Opacity="0" IsHitTestVisible="false" Width="16" Height="16" />

                        </Grid>
                        <ContentPresenter
								Grid.Column="1"
								x:Name="contentPresenter"
								Content="{TemplateBinding Content}"
								ContentTemplate="{TemplateBinding ContentTemplate}"
								HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
								VerticalAlignment="Center"
								Margin="{TemplateBinding Padding}"/>
                    </Grid>
                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Stroke" TargetName="BoxMiddle" Value="{StaticResource DistinctFilterCheckboxMouseOverStroke}" />
                            <Setter Property="Fill" TargetName="BoxMiddle" Value="{StaticResource DistinctFilterCheckboxMouseOverFill}" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Opacity" TargetName="CheckIcon" Value="1" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="Opacity" TargetName="ContentFocusVisualElement" Value="1" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="DisabledVisualElement" Value="0.55" />
                            <Setter Property="Opacity" TargetName="contentPresenter" Value="0.55" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Stroke" TargetName="BoxMiddle" Value="{StaticResource DistinctFilterCheckboxPressedStroke}" />
                            <Setter Property="Fill" TargetName="BoxMiddle" Value="{StaticResource DistinctFilterCheckboxPressedFill}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style for Button -->
    <Style TargetType="Button" x:Key="ButtonStyle">
        <Setter Property="IsEnabled" Value="true" />
        <Setter Property="IsTabStop" Value="true" />
        <Setter Property="MinWidth" Value="5" />
        <Setter Property="MinHeight" Value="5" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Cursor" Value="Arrow" />
        <Setter Property="Padding" Value="20,0,20,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        
                        <Border x:Name="outer" CornerRadius="3,3,3,3"
								BorderThickness="1" BorderBrush="{StaticResource DistinctFilterButtonOuterBorderBrush}">
                            <Border x:Name="inner" CornerRadius="2,2,2,2" BorderThickness="1"
									BorderBrush="{StaticResource DistinctFilterButtonInnerBorderBrush}">
                                <Border x:Name="innerMost" CornerRadius="1,1,1,1"  Background="{StaticResource DistinctFilterButtonInnerMostBackground}">
                                    <ContentPresenter VerticalAlignment="Center"
											HorizontalAlignment="Center"
											Content="{TemplateBinding Content}"
											ContentTemplate="{TemplateBinding ContentTemplate}"
											Margin="6,2" />
                                </Border>
                            </Border>
                        </Border>
                        <Rectangle Stroke="{StaticResource DistinctFilterButtonFocusVisualStroke}" StrokeThickness="1" Margin="0" RadiusX="3"
								RadiusY="3" Fill="{StaticResource DistinctFilterButtonFocusVisualFill}" x:Name="FocusVisual"
								Visibility="Collapsed" />
                        <Rectangle x:Name="DisabledVisual" Visibility="Collapsed" RadiusX="3"
								RadiusY="3" Fill="{StaticResource DistinctFilterButtonDisabledVisualFill}" IsHitTestVisible="false" />
                    </Grid>
                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="innerMost" Property="Background" Value="{StaticResource DistinctFilterButtonInnerMostMouseOverBackground}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="innerMost" Property="Background" Value="{StaticResource DistinctFilterButtonInnerMostPressedBackground}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="DisabledVisual" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="False">
                            <Setter TargetName="FocusVisual" Property="Visibility" Value="Visible" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ScrollViewer -->
	
	<ControlTemplate x:Key="ScrollViewerControlTemplate" TargetType="{x:Type ScrollViewer}">
		<Grid x:Name="Grid" Background="{TemplateBinding Background}">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="Auto"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			<Rectangle x:Name="Corner" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Column="1" Grid.Row="1"/>
			<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Margin="{TemplateBinding Padding}" Grid.Column="0" Grid.Row="0" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False"/>
			<ScrollBar x:Name="PART_VerticalScrollBar" Cursor="Arrow" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Grid.Row="0" AutomationProperties.AutomationId="VerticalScrollBar" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{StaticResource VerticalScrollBarStyle}"/>
			<ScrollBar x:Name="PART_HorizontalScrollBar" Cursor="Arrow" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" Grid.Row="1" AutomationProperties.AutomationId="HorizontalScrollBar" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Style="{StaticResource HorizontalScrollBarStyle}"/>
		</Grid>
	</ControlTemplate>
	<ControlTemplate x:Key="ListBoxControlTemplate" TargetType="{x:Type ListBox}">
		<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
			<ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false" Template="{StaticResource ScrollViewerControlTemplate}">
				<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
			</ScrollViewer>
		</Border>
		<ControlTemplate.Triggers>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
			</Trigger>
			<Trigger Property="IsGrouping" Value="true">
				<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<Style x:Key="ListBoxStyle" TargetType="{x:Type ListBox}">
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Template" Value="{StaticResource ListBoxControlTemplate}" />
	</Style>
	
	
	
	
	
	
	<!--ComboBox-->
	
	<Style x:Key="ComboBoxFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="4,4,21,4" SnapsToDevicePixels="true"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Geometry x:Key="DownArrowGeometry">M 0 0 L 3.5 4 L 7 0 Z</Geometry>
	<Style x:Key="ComboBoxReadonlyToggleButton" TargetType="{x:Type ToggleButton}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="ClickMode" Value="Press"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Grid x:Name="Chrome" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" >
						<Border x:Name="ComboButton" BorderBrush="{StaticResource DistinctFilterComboBoxBorder}" BorderThickness="1" Margin="0" 
								CornerRadius="2" HorizontalAlignment="Stretch"
								Background="{StaticResource ButtonNormalBackground}">
								
							<Path x:Name="Arrow" Fill="Black" HorizontalAlignment="Right" Margin="0,1,5,0" VerticalAlignment="Center" Data="{StaticResource DownArrowGeometry}"/>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="ComboButton" Property="Background" Value="{StaticResource DistinctFilterComboBoxBackground}" />
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Fill" TargetName="Arrow" Value="{StaticResource DistinctFilterArrowFill}"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="True">
							<Setter TargetName="ComboButton" Property="Background" Value="{StaticResource DistinctFilterComboBoxBackground_Over}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="AllowDrop" Value="true"/>
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<ScrollViewer x:Name="PART_ContentHost" Background="Transparent" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="ClickMode" Value="Press"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border x:Name="Chrome" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" >
						<Path x:Name="Arrow" Fill="Black" HorizontalAlignment="Center" Margin="0,1,0,0" VerticalAlignment="Center" Data="{StaticResource DownArrowGeometry}"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Fill" TargetName="Arrow" Value="{StaticResource DistinctFilterArrowFill}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
		<Grid x:Name="Placement" SnapsToDevicePixels="true">

			<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="2">
				<Grid x:Name="Shdw" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=Placement}">
					<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
						<ScrollViewer>
							<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
						</ScrollViewer>
					</Border>
				</Grid>
			</Popup>
			<ListBox x:Name="Border" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
			<ToggleButton Style="{StaticResource ComboBoxToggleButton}" Grid.Column="1" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="IsKeyboardFocusWithin" Value="true">
				<Setter Property="Foreground" Value="Black"/>
			</Trigger>

			<Trigger Property="HasItems" Value="false">
				<Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				<Setter Property="Background" Value="{StaticResource DistinctFilterComboBoxEditableTemplateBorderBackground}"/>
			</Trigger>
			<Trigger Property="IsGrouping" Value="true">
				<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
			</Trigger>
			<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
				<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>

			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<Style x:Key="ComboBoxStyle" TargetType="{x:Type ComboBox}">
		<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
		<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="Padding" Value="4,3"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ComboBox}">
					<Grid x:Name="MainGrid" SnapsToDevicePixels="true">

						<Popup x:Name="PART_Popup" Margin="1" AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="2">
							<Border x:Name="Shdw" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=MainGrid}" Background="Transparent">
								<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
									<ScrollViewer CanContentScroll="true">
										<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
									</ScrollViewer>
								</Border>
							</Border>
						</Popup>
						<ToggleButton Style="{StaticResource ComboBoxReadonlyToggleButton}" BorderBrush="{TemplateBinding BorderBrush}"  IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />

						<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsHitTestVisible="false" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
							<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
							<Setter Property="Background" TargetName="Shdw" Value="#71000000"/>
						</Trigger>
						<Trigger Property="HasItems" Value="false">
							<Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							<Setter Property="Background" Value="#FFF4F4F4"/>
						</Trigger>
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<Trigger Property="IsEditable" Value="true">
				<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/>
				<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
				<Setter Property="IsTabStop" Value="false"/>
				<Setter Property="Padding" Value="3"/>
				<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
			</Trigger>
		</Style.Triggers>
	</Style>

	
	
	
	
	<!-- FilteringDropDown -->
	<ControlTemplate TargetType="grid:FilteringDropDown" x:Key="DistinctFilterControlTemplate">
        <Grid>
            <Grid.Resources>
				
                <telerik:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
				
            </Grid.Resources>

            <ToggleButton x:Name="PART_DropDownButton" Width="20" Height="20">
                <ToggleButton.Template>
                    <ControlTemplate TargetType="ToggleButton">
                        <ContentPresenter />
                    </ControlTemplate>
                </ToggleButton.Template>
                <Grid Width="11" Height="12" Background="Transparent">

                    <Path Fill="{StaticResource DistinctFilterFunnelFill}" Stretch="Fill" Stroke="{x:Null}" Width="11" Height="12" Data="M0,0 L11,0 11,1 10,1 10,2 9,2 9,3 8,3 8,3.9999999 7,3.9999999 7,12 4,12 4,3.9999999 3.0000001,3.9999999 3.0000001,3 2,3 2,2 1,2 1,1 0,1 z"/>
                    <Grid Width="11" Height="12" Visibility="{TemplateBinding FilteringIndicatorVisibility}">
                        <Path Fill="{StaticResource DistinctFilterActiveFunnelFill}" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L1,0 2,0 3,0 4,0 5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0 z" Margin="3.016,1.016,2.984,0" VerticalAlignment="Top" Height="3" RenderTransformOrigin="0.5,0.5">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="0"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                        <Path Fill="{StaticResource DistinctFilterFunnelFill}" Stretch="Fill" Stroke="{x:Null}" Data="M2.9999999,0.99999994 L2.9999999,2 3.9999999,2 3.9999999,3 4.9999999,3 4.9999999,4 5.9999999,4 5.9999999,3 6.9999999,3 6.9999999,2 7.9999999,2 7.9999999,0.99999994 6.9999999,0.99999994 5.9999999,0.99999994 4.9999999,0.99999994 3.9999999,0.99999994 z M0,0 L11,0 11,0.99999994 9.9999999,0.99999994 9.9999999,2 8.9999999,2 8.9999999,3 7.9999999,3 7.9999999,4 6.9999999,4 6.9999999,12 3.9999999,12 3.9999999,4 2.9999999,4 2.9999999,3 1.9999999,3 1.9999999,2 0.99999994,2 0.99999994,0.99999994 0,0.99999994 z"/>
                    </Grid>
                </Grid>
            </ToggleButton>

            

                
                <Popup x:Name="PART_DropDownPopup" StaysOpen="False">
				

                    <Border BorderThickness="1" BorderBrush="#FF8A929E" Padding="5" Background="#FFDFE2E5">
						<StackPanel Width="200">
							<Button x:Name="PART_ClearFilterButton" Margin="0,2,0,2"
									Content="Clear Filter" Style="{StaticResource ButtonStyle}" />
                            <CheckBox x:Name="PART_SelectAllCheckBox" Margin="0,2,0,2"
									Content="Select All" Style="{StaticResource CheckBoxItem}"/>

                            
								<grid:DistinctValuesList 
									
									ScrollViewer.HorizontalScrollBarVisibility="Hidden"
									MaxHeight="250"
                                    Template="{StaticResource ListBoxControlTemplate}"
									
									x:Name="PART_DistinctValuesList"
									DataContext="{TemplateBinding FilterDescription}"
									ItemsSource="{Binding DistinctValues}"  >

									<grid:DistinctValuesList.ItemContainerStyle>
										<Style TargetType="grid:CheckBoxItem">
											<Setter Property="Template">
												<Setter.Value>
													<ControlTemplate TargetType="grid:CheckBoxItem">
														<Grid>
															<CheckBox x:Name="Check" VerticalContentAlignment="Center" 
																	IsChecked="{TemplateBinding IsSelected}"
																	DataContext="{TemplateBinding Content}"
																	Content="{Binding ConvertedValue}" Style="{StaticResource CheckBoxItem}" />
														</Grid>
													</ControlTemplate>
												</Setter.Value>
											</Setter>
										</Style>
									</grid:DistinctValuesList.ItemContainerStyle>
								</grid:DistinctValuesList>
								
                            <StackPanel Width="200" DataContext="{TemplateBinding FilterDescription}" Margin="0,2,0,2">
                                <StackPanel.Resources>
                                    <grid:FilterOperatorConverter x:Key="FilterOperatorConverter" />
                                    <DataTemplate x:Key="ActionTemplate">
                                        <TextBlock Text="{Binding Converter={StaticResource FilterOperatorConverter}}" />
                                    </DataTemplate>
                                </StackPanel.Resources>
                                <TextBlock Text="Show rows with value that" Margin="0,2,0,0" FontWeight="Bold"/>

                                
                                
								<ComboBox x:Name="PART_Filter1ComboBox" ItemsSource="{Binding AvailableActions}" Margin="0,2,0,2"
										  Style="{StaticResource ComboBoxStyle}"
										ItemTemplate="{StaticResource ActionTemplate}"
										SelectedItem="{Binding Filter1.Operator, Mode=OneWay}"/>
						
                                
                                <TextBox x:Name="PART_Filter1TextBox" Text="{Binding Filter1.Value, Mode=OneWay}" Margin="0,2,0,2"
										 Style="{StaticResource TextBoxStyle}" />
                                <TextBlock Text="And" Margin="0,2,0,0" FontWeight="Bold" />

                                
                                
                                <ComboBox x:Name="PART_Filter2ComboBox" Margin="0,2,0,2"
										 Style="{StaticResource ComboBoxStyle}"
										ItemTemplate="{StaticResource ActionTemplate}"
										ItemsSource="{Binding AvailableActions}"
										SelectedItem="{Binding Filter2.Operator, Mode=OneWay}" />
                                
                                <TextBox x:Name="PART_Filter2TextBox" Text="{Binding Filter2.Value, Mode=OneWay}" Margin="0,2,0,2"
										 Style="{StaticResource TextBoxStyle}" />
                            </StackPanel>
                            <Button x:Name="PART_ApplyFilterButton" Content="Filter"  Style="{StaticResource ButtonStyle}"/>
							

							



						</StackPanel>

                    </Border>
                </Popup>
        </Grid>
    </ControlTemplate>

    <Style TargetType="grid:FilteringDropDown"
		
        x:Key="{telerik:ThemeResourceKey ThemeType=local:CustomTheme, ElementType=grid:FilteringDropDown}"
         >
        <Setter Property="Template" Value="{StaticResource DistinctFilterControlTemplate}"/>
    </Style>
    
</ResourceDictionary>