title: WPF DataGrid SelectedItem
body: <p>I have a DataGrid a user can add items to by entering data in the last row. I also have a button that deletes the currently selected item. But when the last (empty, for adding new items) row is selected, whatever was the last selected item remains in SelectedItem. So if I open the window, select the last row, and press the delete button, it will delete the first row, as it is selected by default, and selecting the last row did not change SelectedItem. Any good way to deal with this?</p>
  
  <p>To clarify:
  SelectedItem="{Binding X}"</p>
  
  <p>X in the ViewModel does not change when the last row is selected (the setter isn't invoked at all). I'm not sure whether the SelectedItem property itself changes, but I would assume it doesn't.</p>
  
  <p>There is also an exception when I select the last row (red border), but when I click it again to start entering data, the red border disappers. Not sure if these two are related.</p>