- Create a view model that calls
EnableUndo() or IsUndoRoot() in its WithViewModelBehaviors() method when building the descriptor.
- Inherit a second view model from the first view model (call
Inherits() when building the descriptor).
- Add additional properties to the second view model descriptor.
- Test the undo functionality (call
UndoManager.RollbackTo()).
- Note that changes on the properties in the base view model are reverted, but changes on properties in the inherited view model aren't.
The problem is that VMDescriptorBuilder.ConfigureDescriptor() calls EnableUndo() or IsUndoRoot() before it calls the property builder of the inherited view model. Therefore the properties of the inherited view model are not yet in the ConfiguredProperties collection that is used in EnableUndo().