Bar and Docking Controllers (Customizing Default View and Behavior Settings)
- 3 minutes to read
The DefaultBarAndDockingController and BarAndDockingController allow you to customize the application-scope (global) and form-scope display and customization settings for the controls and components included in the XtraBars library:
- Bars UI (BarManager)
- Ribbon UI (RibbonControl, RibbonForm, RibbonStatusBar, BackstageViewControl, ApplicationMenu)
- Dock panels (DockManager)
- Application UI (Windows UI, Widget UI, Tabbed UI, Native MDI) implemented with the DocumentManager component
- Tabbed MDI windows (XtraTabbedMdiManager)
List of XtraBars Settings
The BarAndDockingController provides the following display and customization settings:
- AppearancesBackstageView - Provides the default appearance settings applied to BackstageViewControl controls.
- AppearancesBar - Provides the default appearance settings of the Bars UI, implemented with the BarManager component.
- AppearancesDocking - Provides the default appearance settings for all dock panels, implemented with the DockManager component.
- AppearancesDocumentManager - Contains the default appearance settings applied to Views of the DocumentManager component.
- AppearancesRibbon - Provides the default appearance settings of the Ribbon Controls and Ribbon Forms.
- LookAndFeel - Provides Look And Feel and Skinning settings for the controls/components included in the XtraBars library.
- PaintStyleName - Gets or sets the name of the paint scheme applied to the Bars UI (BarManager), dock panels (DockManager) and MDI tabbed windows (XtraTabbedMdiManager).
- PropertiesBar - Contains the default customization settings of the Bars UI (BarManager).
- PropertiesDocking - Provides the default customization settings for the Application UI Manager (DocumentManager) and Dock Manager.
- PropertiesRibbon - Provides the default customization properties for the Ribbon UI elements.
To learn how to customize the look-and-feel settings of the XtraBars controls, see Look And Feel and Skinning. The following sections show how you can customize other settings for all forms and individual forms.
Customizing the Default XtraBars Settings for all Forms (Default BarAndDockingController)
Place the DefaultBarAndDockingController component onto the main form to access the global settings shared by all XtraBars controls within all forms.
In code, use the BarAndDockingController.Default property to access and customize these settings.
Customizing the Default XtraBars Settings for Individual Forms (BarAndDockingController)
To specify the default settings for the XtraBars controls/components within a single form, add a BarAndDockingController component to the form.
Ensure that this controller is bound to the target DevExpress XtraBars controls, via their Controller properties.
By default, the Controller properties of the XtraBars controls and components are set to null, which means that the Default BarAndDockingController's settings are in effect for these controls. If you assign a BarAndDockingController object to this property, this controller will provide settings for the corresponding XtraBars control, instead of the Default BarAndDockingController.
When you place a BarAndDockingController component onto a form for the first time, it is automatically assigned to the Controller properties of existing XtraBars controls and components that reside on this form. From that point on, this controller will provide settings for these controls and components.
Suppose you have two forms, each of which features a Bars UI implemented by a BarManager component.
If you want to provide identical settings for all the bars within the two forms, place the DefaultBarAndDockingController component onto the main form and customize its settings. The BarManager.Controller properties of the two BarManagers must be set to null.
If you need to provide independent bar settings for the two forms, do one of the following:
- Use the DefaultBarAndDockingController to customize bar settings within the main form. For the second form, create a new BarAndDockingController and assign it to the BarManager.Controller property.
- Create a BarAndDockingController within each form and ensure that they are assigned to the BarManagers, using their BarManager.Controller properties.