windowsforms-120525-controls-and-libraries-navigation-controls-navigation-bar-navbarcontrol-to-accondioncontrol-converter.md
The NavBarControl and AccordionControl allow you to implement a navigation functionality in your application. The accordion control, which was released later than the nav bar control, provides a modern view and the following features.
To automatically convert an existing NavBarControl to an AccordionControl, invoke the corresponding command in the smart tag menu. The controls are converted automatically, and your assistance is not required. However, this topic describes how controls, groups, and items are interchanged, and which settings are affected.
Tip
Since a backward automatic conversion is not supported, make a back-up copy of the project before proceeding.
Paint Style
The NavBarControl can be displayed in different styles (see NavBarControl.PaintStyleKind). The AccordionControl does not support styles, but it can display the root groups and items in the control footer. This allows it to mimic the nav bar control’s view and behavior.
If the initial NavBarControl is painted in the NavigationPane style, the resulting AccordionControl displays its root groups and items in the control footer.
If the NavBarControl‘s paint style differs from the NavigationPane , the AccordionControl does not display the footer.
Selecting Items
If the NavBarControl‘s NavBarControl.LinkSelectionMode option is set to OneInControl , the AccordionControl also allows users to select items (see AccordionControl.AllowItemSelection).
Other Settings
Review the information below to see how the AccordionControl properties are specified based on the NavBarControl properties. You can adjust these properties after the conversion if necessary.
|
|
| | --- | --- | |
NavBarControl.AllowGlyphSkinning
|
AccordionControl.AllowGlyphSkinning
| |
NavBarControl.AllowHorizontalResizing
|
| |
|
AccordionControl.AllowHtmlText
| |
NavBarControl.Appearance.Background
NavBarControl.Appearance.Hint
NavBarControl.Appearance.GroupHeader
NavBarControl.Appearance.GroupHeaderHotTracked
NavBarControl.Appearance.GroupHeaderPressed
NavBarControl.Appearance.Item
NavBarControl.Appearance.ItemHotTracked
NavBarControl.Appearance.ItemPressed
NavBarControl.Appearance.ItemDisabled
|
AccordionControl.Appearance.AccordionControl
AccordionControl.Appearance.Hint
AccordionControl.Appearance.Group.Normal
AccordionControl.Appearance.Group.Hovered
AccordionControl.Appearance.Group.Pressed
AccordionControl.Appearance.Item.Normal
AccordionControl.Appearance.Item.Hovered
AccordionControl.Appearance.Item.Pressed
AccordionControl.Appearance.Item.Disabled
| |
NavBarControl.ExplorerBarGroupInterval
|
AccordionControl.DistanceBetweenRootGroups
| |
|
| |
|
OptionsMinimizing.MinimizedWidth
| |
|
| |
|
AccordionOptionsFooter.ActiveGroupDisplayMode
| |
|
|
Groups and Items
For each group, item or separator in the nav bar, a corresponding accordion group, item or separator is created. If a nav bar group contains other controls (see NavBarGroup.ControlContainer), these controls are moved to the accordion group. The table below contains equivalent properties of the nav bar and accordion elements.
|
|
| | --- | --- | |
|
AccordionControlElement.Appearance
| |
|
AccordionControlElementBase.Text
| |
Depending on the NavBarGroup.GroupCaptionUseImage or NavBarGroup.GroupStyle property,
the accordion group or item uses large or small images.
|
AccordionControlElementBase.ImageOptions
|
You can enable the HamburgerMenu view for the created AccordionControl by using the AccordionControl.ViewType property. The hamburger menu can be embedded to a FluentDesignForm that features:
To convert the application form to the FluentDesignForm, use the Form Assistant component. For more information, see Fluent Design Form.