Display plugins are registered in ATLAS 10 during application start up; a registered display will also be able to provide menu and toolbar options for the creation of a new display. A registered display can also be saved into and reloaded from a workbook. It should be noted that all displays in ATLAS 10 are plugins using the same API.
A Visual Studio project template is provided with ATLAS 10 to which creates a display plugin with all required boilerplate code.
A display is registered using the IDisplayRegistry interface and should take place in the IAtlasPlugin.Initialise() method of your plugin implementation.
// Unique key for this display type. string displayKey = "TestDisplay"; IDictionary registration = displayRegistry.Register<ITestDisplayView, ITestDisplayViewModel>(displayKey);
The following code will register a menu item for creating a new display:
// Unique key for this display type. string displayKey = "TestDisplay"; // Name of this display. string displayName = "Test Display"; // Description of this display. string displayDescription = "Display for showing my custom data."; // The Uri for the menu icon. Uri iconLocation = @"pack://application:,,,/MyPlugin;component/Resources/icon.png"; displayRegistry.RegisterMenu( displayKey, displayName, displayDescription, iconLocation);
The following code with register a toolbar button for creating a new display:
// Unique key for this display type. string displayKey = "TestDisplay"; // Name of this display. string displayName = "Test Display"; // Description of this display. string displayDescription = "Display for showing my custom data."; // The Uri for the menu icon. Uri iconLocation = @"pack://application:,,,/MyPlugin;component/Resources/icon.png"; // Tooltip for the display toolbar icon. string displayTooltip = "Creates a new TestDisplay."; displayRegistry.RegisterToolbar( displayKey, displayName, displayDescription, iconLocation, displayTooltip);
Comments
0 comments
Please sign in to leave a comment.