This topic explains how to configure the Undo/Redo operations in the xamDiagram™ control. The topic covers configuring an Undo/Redo Manager that is exclusive for xamDiagram . If you prefer to configure a manager that is shared across the controls in your application, refer to Infragistics® Undo/Redo Framework.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
The xamDiagram control provides support for undo/redo functionality by maintaining operations history and executing undo/redo operations.
The undo/redo functionality in Ultimate UI for WPF is provided via the Infragistics Undo/Redo Framework. It is a cross-platform framework and allows for commands-controlled invoking of the undo/redo operations from the UI.
The diagram uses its own instance of the UndoManager class (part of the Infragistics Undo/Redo Framework ) which allows for independent undo/redo history processing. This is the use case covered in detail in this help topic. The alternative approach is to use an external instance of the UndoManager
in order to support shared history across the application.
By default, undo/redo operations are enabled on xamDiagram and can be triggered by user key combinations (Ctrl+Z for undo and Ctrl+Y for redo) or by explicit commands invoking. By default, there is no limit to the number of operations stored in the undo/redo stack, but this number can be controlled via property setting of the UndoManager class.
To enable or disable undo/redo operations in the xamDiagram control, use its IsUndoEnabled property. Setting the value of the property to “False” also clears the current history.
The following table maps the desired behavior to the property settings that manage it.
To clear the current operations history of the xamDiagram control, call its ClearUndoRedoHistory() method. Invoking the method results in clearing the current undo/redo history for the diagram only. (If an external instance of UndoManager has been created, the history for the other controls managed by it will not be affected.)
The following table maps the desired behavior to the property settings that manage it.
The following topics provide additional information related to this topic.