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:
- Add Mark
- Remove Mark
- Change Mark’s Properties
- Resizing the Mark
- Repositioning the Mark – Move, Rotate, Flip
- Change Mark’s Selection
- Change Mark’s Z-Order
- Add Group
- Remove Group
- Change Group’s Properties
- Change Page’s Properties
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.