What is the best practice to place text collected from MyBackgroundPlugin into a MyViewItemWpfUserControl A Wpf Control? I saw the Chat Sample mentioned to do something. Or is there some other way that is best?
All I think I need is: How to Reference MyViewItemWpfUserControl from MyBackgroundPlugin.
With that, does this method call need Invoke to avoid cross-threading?
I think part of what you are searching for is how to reference something from one class in another class for a plugin running in the same process.
I find an example of that in the SCImageViewerAddOnSample.
In the PluginDefintion class of that sample I find:
public override void Init()
{
// Populate all relevant lists with your plugins etc.
if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.SmartClient)
{
var backgroundPlugin = new SCImageViewerAddOnSampleBackgroundPlugin();
_sidePanelPlugins.Add(new SCImageViewerAddOnSampleSidePanelPlugin(backgroundPlugin));
_backgroundPlugins.Add(backgroundPlugin);
}
}
Done this way the SidePanelPlugin can reference the BackgroundPlugin. You can turn it the other way or you can make common properties in the definition. I hope you see the idea.
If the two classes are not in the same process, as an example the background is an Event Server. The idea of using message communication (transmitMessage) is good. For sharing values in the same process, I think it is overkill.