public static void EndEdit(this IEditableObject self) { // accept current state, discard old state var state = self.GetInternalState(); object clone; if (!state.TryGetValue(SystemFields.Shapshot, out clone)) { return; // idempotent } State.Remove(clone); state.Remove(SystemFields.Shapshot); self.SetProperty(SystemFields.IsChanged, false); }