ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Framework.Events Namespace / ActiveToolChangedEvent Class / Unsubscribe Method / Unsubscribe(SubscriptionToken) Method
The registration token.
Example

In This Topic
    Unsubscribe(SubscriptionToken) Method
    In This Topic
    Stop being notified when the event occurs.
    Syntax
    public static void Unsubscribe( 
       SubscriptionToken token
    )
    Public Overloads Shared Sub Unsubscribe( _
       ByVal token As SubscriptionToken _
    ) 

    Parameters

    token
    The registration token.
    Example
    Subscribe to Active Tool Changed Event
    private void SubscribeEvent()
    {
      ArcGIS.Desktop.Framework.Events.ActiveToolChangedEvent.Subscribe(OnActiveToolChanged);
    }
    private void UnSubscribeEvent()
    {
      ArcGIS.Desktop.Framework.Events.ActiveToolChangedEvent.Unsubscribe(OnActiveToolChanged);
    }
    private void OnActiveToolChanged(ArcGIS.Desktop.Framework.Events.ToolEventArgs args)
    {
      string prevTool = args.PreviousID;
      string newTool = args.CurrentID;
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also