ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Framework Namespace / OperationManager Class
Members Example

In This Topic
    OperationManager Class
    In This Topic
    A collection of operations that users can undo and redo.
    Object Model
    OperationManager ClassOperation ClassOperation ClassOperation Class
    Syntax
    public class OperationManager 
    Public Class OperationManager 
    Remarks

    In general, undo operations are organized per ArcGIS.Desktop.Framework.Contracts.Pane and ArcGIS.Desktop.Framework.Contracts.DockPane. In other words, each Pane and DockPane manages its own operation stack. For example, operations added to map A are not visible to map B. The active window (Pane or DockPane) becomes the active OperationManager. When a window becomes active, its OperationManager is requested and connected to the undo/redo user interface.

    Panes and DockPanes may however elect to share OperationManagers. For example, two Panes that are showing the same map will have the same OperationManager.

    Example
    Undo/Redo the Most Recent Operation
    //undo
    if (MapView.Active.Map.OperationManager.CanUndo)
      MapView.Active.Map.OperationManager.UndoAsync();//await as needed
    
    //redo
    if (MapView.Active.Map.OperationManager.CanRedo)
      MapView.Active.Map.OperationManager.RedoAsync();//await as needed
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.OperationManager
          ArcGIS.Desktop.Framework.CompositeOperationManager

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also