Parameters
- category
- The category of operation of undo.
Return Value
A task that represents the work queued to execute in the ThreadPool.
Exception | Description |
---|---|
System.Exception | Thrown when the operation's ArcGIS.Desktop.Framework.Contracts.Operation.CanUndo method returns false. |
System.Exception | Thrown when the operation's ArcGIS.Desktop.Framework.Contracts.Operation.CanUndo method returns false. |
The most recent operation of a particular category in the stack is undone by calling its ArcGIS.Desktop.Framework.Contracts.Operation.UndoAsync method. The operation is then added to this OperationManager's redo stack.
//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
// in order to find a dockpane you need to know it's DAML id var pane = FrameworkApplication.DockPaneManager.Find("esri_core_contentsDockPane"); // get the undo stack OperationManager manager = pane.OperationManager; if (manager != null) { // undo an operation if (manager.CanUndo) await manager.UndoAsync(); // redo an operation if (manager.CanRedo) await manager.RedoAsync(); // clear the undo and redo stack of operations of a particular category manager.ClearUndoCategory("Some category"); manager.ClearRedoCategory("Some category"); }
Target Platforms: Windows 11, Windows 10