ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core.Events Namespace / ProjectOpenedEvent Class
Members Example

In This Topic
    ProjectOpenedEvent Class
    In This Topic
    Occurs when a project has been opened
    Object Model
    ProjectOpenedEvent ClassSubscriptionToken ClassSubscriptionToken Class
    Syntax
    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
      }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.Events.EventBase
          ArcGIS.Core.Events.CompositePresentationEvent<TPayload>
             ArcGIS.Desktop.Core.Events.ProjectOpenedEvent

    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also