ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Framework.Contracts Namespace / Module Class / Uninitialize Method
Example

In This Topic
    Uninitialize Method (Module)
    In This Topic
    When overridden in a derived class, gives the custom Module a chance to uninitialize itself.
    Syntax
    Protected Friend Overridable Sub Uninitialize() 
    protected internal virtual void Uninitialize()
    Example
    How to determine when a project is opened
    {
      // override the Initialize and Uninitialize methods of your add-in's module to subscribe and unsubscribe to the ProjectOpenedEvent
    
      ProjectOpenedEvent.Subscribe(OnProjectOpened); //subscribe to Project opened event
    
      ProjectOpenedEvent.Unsubscribe(OnProjectOpened); //unsubscribe from the event as the module is unloaded
    
      void OnProjectOpened(ProjectEventArgs obj) //Project Opened event handler
      {
        MessageBox.Show($"{Project.Current} has opened"); //show your message box
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also