DockItem.UndoRedoReference Property

DevZest WPF Docking

DockItemUndoRedoReference Property
Gets a value provides a DockItem reference for undo/redo.

Namespace: DevZest.Windows.Docking
Assembly: DevZest.WpfDocking (in DevZest.WpfDocking.dll) Version: 2.5.0.0 (2.5.5912.0)
Syntax
protected virtual IDockItemUndoRedoReference UndoRedoReference { get; }
Protected Overridable ReadOnly Property UndoRedoReference As IDockItemUndoRedoReference
	Get

Property Value

Type: IDockItemUndoRedoReference
The IDockItemUndoRedoReference to provide a DockItem reference for undo/redo. The default implementation returns current DockItem when HideOnPerformClose is , otherwise returns . Derived class can override to provide its own implementation.
Remarks

When undo/redo an operation that previously removes a DockItem from DockControl.DockItems, such as closing a DockItem, a instance of DockItem needs to be retrieved and added back to DockControl.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 breaks the undo/redo chain and clears the undo/redo stack.

See Also