ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Framework.Events Namespace / ToolEventArgs Class / PreviousID Property
Example

In This Topic
    PreviousID Property
    In This Topic
    Gets the DAML ID of the previously active tool.
    Syntax
    public string PreviousID {get;}
    Public ReadOnly Property PreviousID As String
    Example
    Subscribe to Active Tool Changed Event
    private void SubscribeEvent()
    {
      ArcGIS.Desktop.Framework.Events.ActiveToolChangedEvent.Subscribe((args) =>
      {
        string prevTool = args.PreviousID;
        string newTool = args.CurrentID;
      });
    }
    Unsubscribe to Active Tool Changed Event
    private void UnSubscribeEvent()
    {
      ArcGIS.Desktop.Framework.Events.ActiveToolChangedEvent.Unsubscribe((args) =>
      {
        string prevTool = args.PreviousID;
        string newTool = args.CurrentID;
      });
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also