ControlCenter

View as Markdown

Definition

ControlCenter is a XAML-defined class containing the layout and properties of the Control Center window. When altering the Control Center window (for example, to add a menu item into the “New” menu to launch an NTWindow as part of an AddOn, as seen in the example below), a generic reference to a Window object can be cast to ControlCenter specifically.

For a complete, working example of this class in use, download framework example located on our Developing AddOns Overview.

Examples

1private NTMenuItem ControlCenterNewMenu;
2
3protected override void OnWindowCreated(Window window)
4{
5 // We want to place the menu item for the AddOn in the Control Center's "New" menu
6 // First obtain a reference to the Control Center window
7 ControlCenter cc = window as ControlCenter;
8 if (cc == null)
9 return;
10
11 /* Determine we want to place the AddOn in the Control Center's "New" menu
12 Other menus can be accessed via the control's "Automation ID". For example: toolsMenuItem, workspacesMenuItem, connectionsMenuItem, helpMenuItem. */
13 ControlCenterNewMenu = cc.FindFirst("ControlCenterMenuItemNew") as NTMenuItem;
14}