title: DatagridCell style overriden by TextBox style
body: <p>I have a <code>Style</code> for <code>DataGridCell</code> (only triggers are important.)</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}"&gt;
      &lt;Setter Property="Background" Value="Transparent" /&gt;
      &lt;Setter Property="BorderBrush" Value="Transparent" /&gt;
      &lt;Setter Property="BorderThickness" Value="1" /&gt;
      &lt;Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type DataGridCell}"&gt;
                  &lt;Border Background="Transparent" BorderBrush="{TemplateBinding BorderBrush}"   BorderThickness="0"  SnapsToDevicePixels="True" &gt;
                      &lt;ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" Margin="4, 0, 0, 0"/&gt;
                  &lt;/Border&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
      &lt;Style.Triggers&gt;
          &lt;Trigger Property="IsSelected" Value="True"&gt;
              &lt;Setter Property="Foreground" Value="{StaticResource DarkForegroundBrush}" /&gt;
          &lt;/Trigger&gt;
          &lt;Trigger Property="IsEnabled" Value="False"&gt;
              &lt;Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/&gt;
          &lt;/Trigger&gt;
      &lt;/Style.Triggers&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>It works when I define column like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;DataGridTemplateColumn Header="Column1" Width="Auto" IsReadOnly="True"&gt;
       &lt;DataGridTemplateColumn.CellTemplate&gt;
           &lt;DataTemplate&gt;
               &lt;TextBlock Text="{Binding Property1, Mode=OneWay}" /&gt;
           &lt;/DataTemplate&gt;
       &lt;/DataGridTemplateColumn.CellTemplate&gt;
  &lt;/DataGridTemplateColumn&gt;
  </code></pre>
  
  <p>But when I have <code>TextBox</code> instead of <code>TextBlock</code> like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;DataGridTemplateColumn Width="Auto" Header="Column1"&gt;
       &lt;DataGridTemplateColumn.CellTemplate&gt;
             &lt;DataTemplate&gt;
                   &lt;TextBox Text="{Binding Path=Property1, Mode=OneWay}" IsReadOnly="True" TextWrapping="Wrap" /&gt;
             &lt;/DataTemplate&gt;
        &lt;/DataGridTemplateColumn.CellTemplate&gt;
  &lt;/DataGridTemplateColumn&gt;
  </code></pre>
  
  <p>It doesn't work since <code>TextBox</code> has it's own <code>Style</code>. 
  I need to use <code>TextBox</code> because I want to let the user select the text from cell. But also I need the <code>Foreground</code> color to change when the <strong>cell/row</strong> is selected. </p>
  
  <blockquote>
    <p><em>(Background color is dark and foreground color is light, but when a cell/row is selected   then the background color is light and foreground color should be dark)</em></p>
  </blockquote>
  
  <p><strong>EDIT</strong></p>
  
  <p>I edited my question to be more clear. Sorry for previous misunderstandings. My goal here is to have <code>TextBox</code> in <code>DataGridCell</code> and use <code>Trigger</code>s from <code>DataGridCellStyle</code>.</p>
  
  <p>Any help appreciated.</p>