Property UndoRedoReference
| Improve this Doc View SourceUndoRedoReference
Gets a value provides a DockItem reference for undo/redo.
Declaration
protected virtual IDockItemUndoRedoReference UndoRedoReference { get; }
Property Value
Type | Description |
---|---|
IDockItemUndoRedoReference | The IDockItemUndoRedoReference to provide a DockItem reference for undo/redo. The default implementation returns current DockItem when HideOnPerformClose is true, otherwise returns null. Derived class can override to provide its own implementation. |
Remarks
When undo/redo an operation that previously removes a DockItem from DockItems, such as closing a DockItem, a instance of DockItem needs to be retrieved and added back to DockItems. Instead of holding this DockItem instance in the undo stack and preventing it from garbage collected, a instance of IDockItemUndoRedoReference instance is kept in the undo stack. This provides flexibility to optimize memory usage.
DockItem implements IDockItemUndoRedoReference, which returns itself. Returns DockItem itself keeps this DockItem in undo stack and prevents it from garbage collected. Returns a null breaks the undo/redo chain and clears the undo/redo stack.