Select to view content in your preferred language

Subscribe to Map Change Event

05-21-2019 10:27 AM
New Contributor III

Our application does analysis on the current map. When the user clicks on the button to start up our tool, we have the code:

     var mv = MapView.Active;

     MainWindow frm1 = new MainWindow();

     frm1.MainMapView = mv;

Where MainWindow is where the use can run different analysis. This works great till the user either loads a new project or goes to another map in the current project. The variable mv is understandably still referencing the original active map if the user has not closed the MainWindow. Is there a way to capture the event when the map or project does change?

I think this might be similar to:, but there was no response to it.

Thank you,


Tags (2)
0 Kudos
1 Reply
Esri Regular Contributor

Hi Susan

To see if the Active Map view changed in Pro, you can subscribe to the ActiveMapViewChangedEvent

To see if a new project was opened, you can subscribe to the ProjectOpenedEvent

I think these are the events you are looking for.