Skip to main content

Undoable Nodes

Document nodes must not be modified. Instead they may contain Undoable Nodes, a special, modifiable kind of nodes.


The Document Model Framework provides classes for primitive undoable properties as well as undoable data structures. The values that are assigned to an undoable property or undoable data structure must be immutable. The Document Model Framework ensures that all fields of the document node classes used as values are marked as readonly. If a class is immutable but for some reason does not pass the tests, it can be explicitly marked with the Immutable attribute .

If an undoable node refers to a document node then that node is considered to be owned by the undoable property. A node may only have one unique owner. An UndoableCrossReferenceProperty may refer to a node without owning it.

Primitive Undoable Properties

  • Undoable Properties
    The Undoable Property is the most basic kind of undoable node. It is a field where the Document Model Framework can record any change of the field.
  • Undoable Cross Reference Properties
    Undoable Cross Reference Properties are fields that contain references to other document nodes. They enable the Document Model Framework to observe changes to the monitored field.

Undoable Data Structures

  • Undoable Lists
    Undoable Lists correspond to Undoable Properties, but contain a list of values instead of a single value.
  • Undoable Sets
    Undoable Sets are analogous to Undoable Lists and Undoable Dictionaries, but implement sets.
  • Undoable Dictionaries
    Undoable Dictionaries are analogous to Undoable Lists and Undoable Sets, but implement dictionaries.
  • Undoable Keyed Collections
    Undoable Keyed Collections combine features from lists and a dictionarys. The elements are primarily ordered as a list, but may also be indexed by a property of the elements.