I faced the same problem, moreover, this happened not only when the number of source counts is 0, but for any last line in the editing state - after deleting from the editing state, the new record line at the bottom of the grid disappears. I did not find anything better than this - a rather rude and not very quick solution, but at least it works for me and, of course, better than nothing.
Given the DataGrid named grItems, a link to the _vm private view model, which has the Items property used to bind the data grid, the sample code might look like this:
<DataGrid Name="grItems"
ItemsSource="{Binding Path=Items}"
UnloadingRow="DataGridUnloadingRow">
and the code behind:
private void DataGridUnloadingRow(object sender, DataGridRowEventArgs e)
{
grItems.UnloadingRow -= DataGridUnloadingRow;
grItems.ItemsSource = null;
grItems.ItemsSource = _vm.Items;
grItems.UnloadingRow += DataGridUnloadingRow;
}
UPDATE
, , - WPF " ...". , , , Items. - , - . , - "" , , .