I am binding ObservableCollection to xamdatagrid via source property.
<igDP:XamDataGrid DataSource="{Binding Path=MyCollection}" />
One way I can do it is to use
_items.CollectionChanged += ItemsChanged
But this seems too late because items are already removed. Is there any nice solution to it?
Update
Items are deleted manually by user via xamdatagrid.
Thanks
You shouldn't delete row directly in the Grid, UI is not responsible for performing Business Actions, this should be performed by ViewModel and before that ViewModel should do validation.
in DataGrid:
On View Model you will have DeleteOrderCommand.
If you replace this View with some other technology and new Control does not have delete row option you would use button. So you could still reuse your ViewModel as button would bind to the DeleteOrderCommand or to the method that this command is calling, as well your validation is in ViewModel so it hasn't disappeared when you switched to View in new technology.
UPDATE: You can use CanExecute on DeleteOrderCommand for validation purposes, or if it is more convenient in the Execute method of Command.