I want to execute my addin code after opening project in arcpro. I've config file which stores project related data. Now whenever I open project I need to activate addin and execute code to retrieve config file, to avoid this behavior I would like to execute some code by default on opening project.
Any help would be appreciated,
Solved! Go to Solution.
It seems that you got your add-in to work, but I just wanted to point out that by default add-ins are 'Just-in-time' (JIT) loaded, meaning they are not loaded and running until you interact through the UI with your add-in. If you want your add-in to work from startup (i.e. in order to listen to a project open/close event) you have to change the JIT default behavior by turning the 'autoload' (in config.daml) to true. You can find more documentation here: ProConcepts Framework · Esri/arcgis-pro-sdk Wiki (github.com)
Usually you would not initialize a ProWindow before the class is instantiated, which happens when the ProWindow needs to open. I would recommend to move any initialization code into the Module class and make it accessible through an internal (or public) property in the Module class as in this example: Framework - ProWindowMVVM Community Sample