TabControlManager

View as Markdown

Definition

The TabControlManager class can be used to set or check several properties of a TabControl. Rather than instantiating a TabControlManager object, you can use the public static methods of the class to set specific properties for a specified TabControl, as in the example code below.

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

Setters

MethodDescription
SetCanAddTabs(DependencyObject obj, bool value)Sets a TabControl can add new tabs
SetCanDuplicateTabs(DependencyObject obj, bool value)Sets a TabControl can duplicate tabs in new tabs or new windows
SetCanRemoveTabs(DependencyObject obj, bool value)Sets a TabControl can remove tabs
SetFactory(DependencyObject obj, bool value)Sets the NTTabFactory for the TabControl
SetIsSimulation(DependencyObject obj, bool value)Sets the current NTTabPage to the simulation color if true. This method needs to be used logically from within your NTTabPage.
SetIsMovable(DependencyObject obj, bool value)Sets a TabControl allows changing the order of tabs in a window

Getters

MethodDescription
GetCanAddTabs(DependencyObject obj)Indicates a TabControl can add new tabs
GetCanDuplicateTabs(DependencyObject obj)Indicates a TabControl can duplicate tabs in new tabs or new windows
GetCanRemoveTabs(DependencyObject obj)Indicates a TabControl can remove tabs
GetFactory(DependencyObject obj)Obtains the NTTabFactory used by a TabControl
GetIsSimulation(DependencyObject obj)Indicates the Simulation Color selected in the Options menu is visible in the tab background when a simulation account is selected in the tab
GetIsMovable(DependencyObject obj)Indicates a TabControl allows changing the order of tabs in a window

Examples

1public AddOnFrameworkWindow()
2{
3 // TabControl should be created for window content if tab features are wanted
4 TabControl tc = new TabControl();
5
6 // Attached properties defined in TabControlManager class should be set to achieve tab moving, adding/removing tabs
7 TabControlManager.SetIsMovable(tc, true);
8 TabControlManager.SetCanAddTabs(tc, true);
9 TabControlManager.SetCanRemoveTabs(tc, true);
10
11 // if ability to add new tabs is desired, TabControl has to have attached property "Factory" set.
12 TabControlManager.SetFactory(tc, new AddOnFrameworkWindowFactory());
13 Content = tc;
14
15 /* In order to have link buttons functionality, tab control items must be derived from Tools.NTTabPage
16 They can be added using extention method AddNTTabPage(NTTabPage page) */
17 tc.AddNTTabPage(new AddOnFrameworkTab());
18}