Version

Configuring Undo/Redo Operations (xamDiagram)

Topic Overview

Purpose

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.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic provides a conceptual overview of the xamDiagram control and its main features and capabilities.

This topic explains how to add the xamDiagram control to a WPF application.

This topic provides an overview of the Infragistics Undo/Redo Framework™ and provides links to some more detailed topics about the undo/redo functionality.

Introduction

xamDiagram Undo/Redo functionality summary

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.

Enabling/Disabling the Undo/Redo Functionality

Overview

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.

Property settings

The following table maps the desired behavior to the property settings that manage it.

In order to: Use this property: And set it to:

Enable undo/redo operations on the diagram

“True”

Disable undo/redo operations on the diagram

“False”

Clearing the Undo/Redo History

Overview

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.)

Property settings

The following table maps the desired behavior to the property settings that manage it.

In order to: Use this method:

Clear the undo/redo history of the diagram

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides a summary of all user interaction tasks in the xamDiagram control.

This topic explains the operational logic of the commands available in the xamDiagram control.

This topic explains how to use the commands provided by xamDiagram in UI element controls such as menus and buttons.

This topic explains how to change the keyboard shortcuts associated with xamDiagram commands.

This is a group of topics containing reference information about the Infragistics Undo\Redo Framework key methods and properties. The topics included cover the reference information about the major framework classes and reference information based on the task you want to achieve with the Undo\Redo API.