title: How do you change WPF DataGrid cell background while editing the cell?
body: <p>The following is an example of how to set the background when the cell is selected, but when I actually click inside the cell to edit it the color changes. Is there a trigger property for when a cell is being edited? I'd like the background not to change.</p>
  
  <pre><code>&lt;DataGrid Name="DG1" ItemsSource="{Binding}" SelectionUnit="Cell" &gt;
      &lt;DataGrid.CellStyle&gt;
          &lt;Style TargetType="DataGridCell" &gt;
              &lt;Style.Triggers&gt;
                  &lt;Trigger Property="IsSelected" Value="True"&gt;
                      &lt;Setter Property="Background" Value="SeaGreen"/&gt;
                  &lt;/Trigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/DataGrid.CellStyle&gt;
  &lt;/DataGrid&gt;
  </code></pre>
  
  <p>Answering my own question, it looks like the Cell background color is based off of <code>SystemColors.WindowBrushKey</code>. Overriding that resource like such <code>&lt;SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="Red" /&gt;</code> did the trick.
  `</p>