ArcGIS Pro 3.2 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
    protected override bool Initialize() //Called when the Module is initialized.
    {
      ProjectOpenedEvent.Subscribe(OnProjectOpened); //subscribe to Project opened event
      return base.Initialize();
    }
    
    private void OnProjectOpened(ProjectEventArgs obj) //Project Opened event handler
    {
      MessageBox.Show($"{Project.Current} has opened"); //show your message box
    }
    
    protected override void Uninitialize() //unsubscribe to the project opened event
    {
      ProjectOpenedEvent.Unsubscribe(OnProjectOpened); //unsubscribe
      return;
    }
    Inheritance Hierarchy

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

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also