Smart Client Dynamic View with InsertViewItemPlugin

Hi,

Any sample where smart client dynamic view opens another plugin item (custom viewitemplugin) than what is inbuilt.

sample uses this

public abstract void InsertBuiltinViewItem(int index, Guid builtinId, Dictionary<string, string> properties);

how to use

public abstract void InsertViewItemPlugin(int index, ViewItemPlugin viewItemPlugin, Dictionary<string, string> properties);

viewAndLayoutItem.InsertBuiltinViewItem(index++,

ViewAndLayoutItem.CameraBuiltinId,

new Dictionary<string, string>()

{

{ "CameraId", alarm.EventHeader.Source.FQID.ObjectId.ToString() }

});

how to insert viewAndLayoutItem.InsertViewItemPlugin?

Thanks,

Vega Support.

Yes, the Property sample uses InsertViewItemPlugin.

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

https://www.nuget.org/profiles/milestonesys

That will be in the same project(Property sample).

Can dynamic view load other plugin that is available in plugin folder that loads on smartclient start?

Can dynamic view open with custom plugins?

I referred to the wrong sample.

The ViewCreateWpfUserControl in the SCViewAndWindow sample does exactly what you need.

To make sure I was not misleading you I did a very quick and dirty proof of concept. I added this snippet of code to the DynamicView sample (DynamicViewBackgroundPlugin.cs, line 146):

ViewItemPlugin myVip = null;
List<PluginDefinition> plugins = EnvironmentManager.Instance.AllPluginDefinitions;
foreach (PluginDefinition pd in plugins)
{
	if (pd.ViewItemPlugins != null)
	{
		foreach (ViewItemPlugin vi in pd.ViewItemPlugins)
		{
			if (vi.Id == new Guid("a7f45b0d-a306-4a22-a820-e3c0c2a426d0")) myVip = vi; // PropertyViewItemPlugin
		}
	}
}
viewAndLayoutItem.InsertViewItemPlugin(index++, myVip, null);

This code is not nice or robust, I will leave it to you to do the necessary in your plugin..

Note that I am using the Property sample plugin, make sure you have both plugins when testing..

Thanks for your quick support.