I coded a dockpane as an addin. a button clicked opens the dockpane.
when I click the x on the top-right corner, the dockpane is closed. when I close ArcGIS Pro after closing the dockpane using the x, the dockpane remains closed on starting ArcGIS Pro the next time. that's great.
I'd like to implement this as a function. meaning that some listener realises, that ArcGIS Pro is getting closed and closes the dockpane too. the dockpane remains closed when I open ArcGIS Pro again, but can be activated again using the button.
How can I implement such a listener, that checks if ArcGIS Pro gets closed?