IEditableObject.CancelEdit is not called for AddRecords, and I think I understand why, because of the unique internal handling for that grid record. However, I have some logic in CancelEdit that I need also for the AddRecord (namely to reset a dirty data flag after cancellation), and I was wondering where to put that code for the AddRecord. XDG.RecordUpdateCanceling/ed is okay, and though not as smitten with MVVM as others, I like to keep code behind to a minimum. Any ideas? Thanks.
PS - I've also thought of relaying the event via Blend behaviors. Looking for other ideas.
I just discovered that XDG.RecordUpdateCanceling/ed in fact won't work either, because the dirty record is still in the BindingList when the event is fired. I must check for any other dirty items before clearing the dirty data flag, and the dirty AddRecord I'm "cancelling" is still there in this event.
In case I've obscured my intent, I want to clear a dirty data flag after cancelling an edit for an add or update, when there are not other dirty items (hence the problem above for the AddRecord that is not yet cleared when for XDG.RecordUpdateCanceling/ed).