Hello,
I’ve been trying to figure this out for the last 2 days with no luck. So frustrating because it’s literally the only thing that is left to do.
I have a Background plugin listening to WebSocket events (receiving images). This part works.
I want to send these images to the Client ViewItemWpfUserControl. I tied to follow the “SCExport” example in PlatformSamples solution by declaring a static instance of the Client ViewItem control in the Background plugin (and then setting it in ViewItem init) and this does not work because it looks like ViewItem creates its own instance of Background so Background instance of ViewItem is always null.
Anyway, I decided to try to use EnvironmentManager.Instance.SendMessage instead (I actually think it’s a more elegant solution) but can’t figure out how to make this work… messages are sent but not seen on the ViewItem side.
This is what I register on the Client ViewItem side, where I want to filter messages only from the Background plugin.
EnvironmentManager.Instance.RegisterReceiver(new MessageReceiver(UpdateAlerts), new KindFilter(MyPluginDefinition.MyPluginBackgroundPlugin));
And this is how I try to send the message. I already tried different type of built in message types, etc. and nothing works.
EnvironmentManager.Instance.SendMessage(new Message("EvolvMsg") { Data = myImage }, null, new FQID() { Kind = MyPluginDefinition.MyPluginBackgroundPlugin });
Could someone please let me know how to fix this? Or perhaps there’s a better way. Thank you!