Created a VideoOS.Platform.Client.ViewItemPlugin. Dragged it into Smart Client view. When I change to a view without myViewItemPlugin, I would like to disable the running myViewItemPlugin.
Should I use HideSetupItem? How do I reference myViewItemPlugin from a different object? Should I use ClientControl.Instance… ?
For clarity, the plug-in is filtering event records, and then generating a tone / beeping upon certain conditions. We want the plug-in to only be executing (filtering and generating tones) when it is visible in a view.
As such, we are trying to detect when the plug-in is in a view that is active, and then only execute the filtering, etc, when active.
The ViewItemPlugin itself is always ‘active’ as such since it will be available for the user to drag in and is also referenced by the views that is using it (even though they might not be active yet).
However, each instance of the ViewItemManager (corresponding to each view item in any view holding your view item) could keep a reference to the ViewItemUserControl it generates (when the view containing is selected by the user) and the user control itself would know if it is active based on Init() and Close() having been called.
All in all this would give you the information needed and it could then be passed on either by querying or using some appropriate callbacks.