Since you didn’t talk much about what your toolbar does, I’m going to assume that when you have several tabs, open it using some resources ... memory, network, connections to a remote source, etc.
Instead of making sure that only one instance is working, my suggestion is to keep track of which tab is active by listening to the WindowStateChanged event, then you can do many things:
- Turn off your connection while it is inactive.
- Inform the remote source that the tab is not active.
- Just do not show notifications on inactive tabs.
- Stop all threads running on the toolbar.
- Etc.
source share