Skip to content

EnableUndo/IsUndoRoot doesn't enable the undo behavior for properties in inherited view models #1

@cremor

Description

@cremor
  1. Create a view model that calls EnableUndo() or IsUndoRoot() in its WithViewModelBehaviors() method when building the descriptor.
  2. Inherit a second view model from the first view model (call Inherits() when building the descriptor).
  3. Add additional properties to the second view model descriptor.
  4. Test the undo functionality (call UndoManager.RollbackTo()).
  5. 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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions