<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="Common/CommonStyles.xaml"/>
    <ResourceDictionary Source="Common/DataGridExStyles.xaml"/>
  </ResourceDictionary.MergedDictionaries>

  <Style x:Key="DGColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}" BasedOn="{StaticResource DataGridColumnHeaderStyle}">
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
  </Style>

  <Style x:Key="DGCellStyle" TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource DataGridCellStyle}">
    <Setter Property="FontFamily" Value="Consolas"/>
    <Setter Property="FontSize" Value="14"/>
    <Setter Property="MinHeight" Value="25"/>
    <Setter Property="TextBlock.TextAlignment" Value="Center"/>
    <Style.Triggers>
      <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="True">
        <Setter Property="Background" Value="#00FFFFFF"/>
      </DataTrigger>
      <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsReadOnly}" Value="True">
        <Setter Property="Foreground" Value="#888"/>
      </DataTrigger>
      <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled}" Value="False">
        <Setter Property="Foreground" Value="#555"/>
      </DataTrigger>
      <MultiDataTrigger>
        <MultiDataTrigger.Conditions>
          <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled}" Value="True"/>
          <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="True"/>
          <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsReadOnly}" Value="True"/>
        </MultiDataTrigger.Conditions>
        <Setter Property="Foreground" Value="#DDD"/>
      </MultiDataTrigger>
      <MultiDataTrigger>
        <MultiDataTrigger.Conditions>
          <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled}" Value="False"/>
          <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="True"/>
          <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsReadOnly}" Value="True"/>
        </MultiDataTrigger.Conditions>
        <Setter Property="Foreground" Value="#60999999"/>
      </MultiDataTrigger>
    </Style.Triggers>
  </Style>

  <Style x:Key="DGCellTextRight" TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource DGCellStyle}">
    <Setter Property="Padding" Value="5,0"/>
    <Setter Property="TextBlock.TextAlignment" Value="Right"/>
  </Style>

  <Style x:Key="DGCellTextLeft" TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource DGCellStyle}">
    <Setter Property="Padding" Value="5,0"/>
    <Setter Property="TextBlock.TextAlignment" Value="Left"/>
  </Style>

</ResourceDictionary>