How to Design a View - TechNet Articles - United States (English) - TechNet Wiki

This page is now retired and kept for archival purposes. This programming guide has been published on MSDN at http://msdn.microsoft.com/library/jj860311.aspx

The information in this topic applies only to System Center 2012 SP1.

Table of Contents

A view add-in is declared in a class that inherits from Microsoft.SystemCenter.VirtualMachineManager.UIAddIns.ViewAddInBase. This add-in provides a control to be displayed in the Virtual Machine Manager (VMM) console. This topic 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

  1. Create a new class that inherits from Microsoft.SystemCenter.VirtualMachineManager.UIAddIns.ViewAddInBase.

  2. Declare the System.Addin.AddinAttribute attribute on the class and give it a unique name.

  3. Mark the scope of the class as public.

  4. Override the CreateViewControl method to supply the console with a view.

  5. Optionally override the GetButtonLabelString method to supply an alternative caption for the ribbon button.

  6. Optionally override the SetScopeType method when you want to know if the console scope changes.

Example

The following code example provides a skeleton that can be used when you are creating a new add-in. You will want to change the type of control 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;
    }
}

Compiling the Code

Namespaces

System.Windows



System.Windows.Controls



Microsoft.SystemCenter.VirtualMachineManager.UIAddIns



System.AddIn



Assemblies

System.AddIn



PresentationFramework



Microsoft.SystemCenter.VirtualMachineManager.UIAddIns



See Also