title: DataGrid.Items.Count doesn't work as per expectation
body: <p>I have a WPF <code>DataGrid</code> named <code>datagrid1</code> and I want to check if <code>DataGrid</code> rows are not empty.</p>
  
  <p>Then how could I achieve this. I tried this but failed.</p>
  
  <pre><code>if (dataGrid1.Items.Count != 0)
  {
        //submit
  }
  else
  {
        MessageBox.Show("Data Grid is empty");
  }
  </code></pre>