ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Framework.Contracts Namespace / DockPane Class / OperationManager Property
Example

In This Topic
    OperationManager Property (DockPane)
    In This Topic
    Gets the OperationManager associated with the DockPane.
    Syntax
    Public Overridable ReadOnly Property OperationManager As OperationManager
    public virtual OperationManager OperationManager {get;}
    Remarks

    Each Pane and DockPane instance by default has their own OperationManager which represents an operation stack. The application's undo/redo controls work with the current OperationManager which is established by the active window. When a Pane or DockPane is activated, its OperationManager is requested. Derived classes can use this method to provide their own OperationManager. For example, Map Panes representing a specific Map, all share the same OperationManager.

    Example
    Dockpane undo / redo
    {
      // in order to find a dockpane you need to know its DAML id
      pane = FrameworkApplication.DockPaneManager.Find(dockPaneID);
    
      // get the undo stack
      OperationManager manager = pane.OperationManager;
      if (manager != null)
      {
        // undo an operation
        // Use await with UndoAsync and RedoAsync
        if (manager.CanUndo)
          manager.UndoAsync().Wait();
    
        // redo an operation
        if (manager.CanRedo)
          manager.RedoAsync().Wait();
    
        // clear the undo and redo stack of operations of a particular category
        manager.ClearUndoCategory("Some category");
        manager.ClearRedoCategory("Some category");
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also