Using the Addin Windows approach is proving to be a good solution to providing simple bits of UI, which a user can move around and dock etc.
I've come across an interesting challenge.
If a user has a particular Addin Window opened, and it's contents depend on what the user has got selected, then the polite behaviour is to handle the EA_OnContextItemChanged event from EA, and change the contents of the already opened Addin Window to show what's needed for the new element.
Exactly like the EA 'Properties' pane.
This works just fine.
But now the user closes the Addin Window, using the 'X' top right.
What seems to happen is that the Addin Window is still alive, but just not visible. @Sparx - can you confirm this?
The behaviour which a user would expect now is different. They closed the Addin Window, so when they select a different object, nothing interesting should happen. Because they closed the Addin Window. Just the same bevaviour as, for example, the EA Properties pane. If I close the Peroerties pane, then switching elements doesn't make it suddenly pop-up if I previously closed it.
But how to detect that the user previously closed the Addin Window? It seems to be still alive as a object, and the act of 'closing' it in EA doesn't seem to fire any windows events, like 'Dispose' or 'Handle_Destroyed', maybe because EA hasn't destroyed anything. Maybe EA just made it invisible. But how to find this out?
Has anyone else come across this issue? How to detect if an Addin Window has been opened, but then closed by the user.
Thanks