<!--***********************************************************************************

   Extended WPF Toolkit

   Copyright (C) 2007-2013 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   For more features, controls, and fast professional support,
   pick up the Plus Edition at http://xceed.com/wpf_toolkit

   Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids

  **********************************************************************************-->

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:primitives="clr-namespace:Xceed.Wpf.Toolkit.Primitives" >

   <!-- =============================================================================== -->
   <!-- SelectorItem                                                                    -->
   <!-- =============================================================================== -->

   <Style TargetType="{x:Type primitives:SelectorItem}">

      <Setter Property="HorizontalContentAlignment"
              Value="{Binding Path=HorizontalContentAlignment,RelativeSource={RelativeSource AncestorType={x:Type primitives:Selector}}}" />
      <Setter Property="VerticalContentAlignment"
              Value="{Binding Path=VerticalContentAlignment,RelativeSource={RelativeSource AncestorType={x:Type primitives:Selector}}}" />
      <Setter Property="Padding"
              Value="4,0,0,0" />
      <Setter Property="IsTabStop"
               Value="False" />

      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="{x:Type primitives:SelectorItem}">
               <Border x:Name="_background"
                       Background="{TemplateBinding Background}"
                       BorderBrush="{TemplateBinding BorderBrush}"
                       BorderThickness="{TemplateBinding BorderThickness}">
                  <!-- In Classic Theme, The Foreground shouldn't be applied to Checkmark and Text-->
                  <CheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource TemplatedParent}}"
                            Padding="{TemplateBinding Padding}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                     <CheckBox.Content>
                        <ContentControl Content="{TemplateBinding Content}"
                                        ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        Foreground="{TemplateBinding Foreground}" />
                     </CheckBox.Content>
                  </CheckBox>
               </Border>
               <ControlTemplate.Triggers>
                  <Trigger Property="IsMouseOver" Value="true">
                     <Setter TargetName="_background" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                     <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
                  </Trigger>
                  <Trigger Property="IsKeyboardFocusWithin" Value="true">
                     <Setter TargetName="_background" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                     <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
                  </Trigger>
               </ControlTemplate.Triggers>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

</ResourceDictionary>
