How should a ViewItem communicate with a Background plugin

How should a ViewItem communicate with a Background Dynamic View plugin so that a button allows the data to go through to the background plugin for it to create a view.

I’ve seen in the DynamicView example that it subscribes to messages, how do they work?

Are they sent by alarms on arrival or by clicking in the alarm line within the manager?

Yes, the Dynamic View plugin sample subscribes to the message that is transmitted when a user picks a line in the Alarm List.

If you want to subscribe to an event hat happens when there is a new Alarm it is the “Server.NewAlarmIndication”. Ref. https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_messaging_1_1_message_id_1_1_server.html&tree=tree_search.html?search=newalarm

You can see it in use in the Alarm and Event Viewer sample. https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/alarmeventviewer/readme.html&tree=tree_2.html

It is also mentioned in the Smart Client Overlay Graph on Event plugin sample.

https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/scoverlaygraphonevent/readme.html&tree=tree_1.html

https://github.com/milestonesys

See also https://doc.developer.milestonesys.com/html/index.html?base=reference/architecture/plug-in_integration.html&tree=tree_1.html

Let me know if this is possible, can I send a message through the button press with a custom key, whilst having the background plugin listening to the same key? Is there some way to do this?

Yes.

Use VideoOS.Platform.EnvironmentManager.RegisterReceiver and VideoOS.Platform.EnvironmentManager.SendMessage ( or VideoOS.Platform.EnvironmentManager.PostMessage ).

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_environment_manager.html&tree=tree_search.html?search=environmentmanager

The SCToolbarPlugin does this

https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/sctoolbarplugin/readme.html&tree=tree_1.html