1
Vote

oldValue and newValue are swapped in the memberchanged event after Undo() operation

description

Like the title says, the oldValue and the newValue are swapped in the memberchanged event after an undo operation. To fix this, just change (in UndoRedoProperty.cs)
this:
 
void IChangedNotification.OnChanged(CommandDoneType type, IChange change)
{
UndoRedoMemberExtender.OnChanged(this, type, change.NewObject, change.OldObject);
}
 
to this:
 
void IChangedNotification.OnChanged(CommandDoneType type, IChange change)
{
if (type == CommandDoneType.Undo)
    UndoRedoMemberExtender.OnChanged(this, type, change.OldObject, change.NewObject);
else
    UndoRedoMemberExtender.OnChanged(this, type, change.NewObject, change.OldObject);
}

comments