title: null cell return when changing its background color
body: <p>I have a <code>DataGrid</code> where I want to retrieve the cell and change its content and its color when I perform a double-click.</p>
  
  <p>The logical sequence is the following: I have my dates in a  <code>DataGrid</code>, they are white and without any content, when I double click it turns red and the content appears unavailable. If I click again it turns white again and its content empty.</p>
  
  <p>I can leave it red, but when I click again and let it white, my function to fetch the cell returns <code>null</code>, even the value being valid. It only works when the cell is white.</p>
  
  <pre><code>private void gvPreV_MouseDoubleClick(object sender, MouseButtonEventArgs e)
  {
      DataGrid dg = sender as DataGrid;
  
      int indexRow = dg.Items.IndexOf(dg.CurrentItem);
      int indexCol = dg.CurrentCell.Column.DisplayIndex;
  
      var cellInfo = new DataGridCellInfo(gvPreV.Items[indexRow], gvPreV.Columns[indexCol]);
      var cell = GetCell(cellInfo); // &lt;~ return null when bg is red
  
      if (cell != null)
      {
          string aux = cell.Content.ToString();
          SolidColorBrush cor = null;
  
          if (aux == "unavailable")
          {
              cor = new SolidColorBrush(Color.FromArgb(100, 200, 57, 57));
              cell.Content = "";                  
           }
           else
           {
              cor = new SolidColorBrush(Color.FromArgb(100, 218, 57, 57));
              cell.Content = "unavailable";                   
           }
           cell.Background = cor;
      }
      else
          MessageBox.Show("Error, Cell empty");
  }
  
  
  
  public DataGridCell GetCell(DataGridCellInfo cellInfo)
  {
      var cellContent = cellInfo.Column.GetCellContent(cellInfo.Item);
      if (cellContent != null)
          return (DataGridCell)cellContent.Parent;
      return null;
  }
  </code></pre>
  
  <p>How do I make the same cell as the unavailable value and background red go back to white when the double click occurs?
  The <code>GetCell</code> method returns <code>null</code> when the position of a red unavailable cell is passed.</p>