How to Design a View
Updated: January 15, 2013
Applies To: System Center 2012 SP1
A view add-in is declared in a class that inherits from ViewAddInBase. The view add-in provides a control that is displayed in the Virtual Machine Manager (VMM) console. The following procedure demonstrates the steps that are required to create a view add-in and provides an example that you can reuse in your own code.
To create a new action add-in
Create a new class that inherits from ViewAddInBase.
Declare the T:System.Addin.AddinAttribute attribute on the class and give it a unique name.
Mark the scope of the class as
public.Override the
CreateViewControlmethod to supply the console with a view.Optionally, override the
GetButtonLabelStringmethod to supply an alternative caption for the ribbon button.Optionally, override the
SetScopeTypemethod when you want to know if the console scope changes.
The following code example provides a skeleton that you can use when you create a new add-in. You must change the type of control that is returned to your own view:
[AddIn("View Add-in 1")]
public class MyViewAddIn : ViewAddInBase
{
private Control _viewControl;
public override FrameworkElement CreateViewControl()
{
_viewControl = new Control();
return _viewControl;
}
}
Namespaces
| System.Windows |
| System.Windows.Controls |
| Microsoft.SystemCenter.VirtualMachineManager.UIAddIns |
| System.AddIn |
Assemblies
| System.AddIn |
| PresentationFramework |
| Microsoft.SystemCenter.VirtualMachineManager.UIAddIns |
Base Classes
User Interface Extension Overview
How to Define a View in the Manifest
How to Use Context Objects with a View [VMMUISDK]
