ImageGear for Silverlight
Undoing & Redoing Edit Operations
Send Feedback
ImageGear for Silverlight User Guide > Using ImageGear for Silverlight > Using ImageGear.ART Namespace > Creating, Saving, Loading, Modifying, and Deleting ART Marks > Undoing & Redoing Edit Operations

Glossary Item Box

All Undo/Redo operations are managed by the ImGearARTHistory class. The ImGearARTPage has a corresponding read-only property to access this class instance: ImGearARTPage.History.

To use the Undo/Redo functionality, it is necessary to enable it first; use ImGearARTHistory.IsEnabled to toggle this functionality. When enabled, the History will record the following ART editing operations:

There are 2 separate properties to toggle the recording of Mark’s selection and z-order change: ImGearARTHistory.IsSelectionRecorded and ImGearARTHistory.IsZOrderRecorded which are set to False by default (to not congest the Undo stack).

Recording of Undo history may be a memory consuming operation, especially in the case of adding/removing the marks/groups. It can easily bring an out-of-memory condition. To limit the number of Undo records, use the ImGearARTHistory.Limit property, which by default is 0 (which means 'no limit').

The ImGearARTHistory allows grouping of multiple edit operations into a single Undo/Redo operation. Use ImGearARTHistory.BeginGroupingHistory() to start the recording of edit operations into the single action. Use ImGearARTHistory.EndGroupingHistory() to stop recording of the single Undo/Redo action.

The ImGearARTHistory.UndoCount and ImGearARTHistory.RedoCount tell how many times ImGearARTHistory.Undo() and ImGearARTHistory.Redo() can be called.

If there were grouping of several edit operations, ImGearARTHistory.UndoCount and ImGearARTHistory.RedoCount will consider them as a single operation.

Providing Undo and Redo Functionality for Custom Marks

If you have implemented some Custom Marks, (derived from the ImGearARTCustomMark to provide Undo/Redo functionality for its properties), it is necessary to call ImGearARTMark.OnPropertyChanged.

©2013. Accusoft Corporation. All Rights Reserved.