Back to Devexpress

OfficeNavigationBar.NavigationClient Property

windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-officenavigationbar.md

latest5.3 KB
Original Source

OfficeNavigationBar.NavigationClient Property

Assign a NavBarControl, AccordionControl or NavigationFrame to this property to automatically fill this OfficeNavigationBar with items that match NavigationClient’s items. If the OfficeNavigationBar.AllowItemSelection property is enabled, OfficeNavigationBar item selection forces the associated Accordion/NavBarControl to select a corresponding group.

Namespace : DevExpress.XtraBars.Navigation

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(null)]
[DXCategory("Navigation Client")]
public INavigationBarClient NavigationClient { get; set; }
vb
<DefaultValue(Nothing)>
<DXCategory("Navigation Client")>
Public Property NavigationClient As INavigationBarClient

Property Value

TypeDefaultDescription
DevExpress.Utils.Navigation.INavigationBarClientnull

A control that implements the INavigationBarClient interface which serves as an item source for this OfficeNavigationBar.

|

Remarks

The animation below illustrates an OfficeNavigationBar with three items. When a user selects an item, the NavBarControl automatically activates the corresponding group. Animation effects are provided by the Navigation Frame control.

This interaction fails if:

Note

OfficeNavigationBar items retrieved from NavigationClient groups are initialized when the application starts, and do not exist at design time. For that reason, do not use the OfficeNavigationBar.SelectedItem property at design time to choose the initially selected OfficeNavigationBar item \ NavigationClient group. Instead, use the AccordionControl.SelectedElement and NavBarControl.ActiveGroup properties of the NavigationClient.

To customize auto-generated OfficeNavigationBar items, handle the OfficeNavigationBar.RegisterItem event. The following sample illustrates how to assign the same vector icons Accordion groups use to OfficeNavigationBar items.

csharp
private void officeNavigationBar1_RegisterItem(object sender, DevExpress.XtraBars.Navigation.NavigationBarNavigationClientItemEventArgs e) {
    e.Item.ImageOptions.SvgImageSize = new Size(24, 24);
    e.Item.ImageOptions.SvgImage = (e.NavigationItem as AccordionControlElement).ImageOptions.SvgImage;
}
vb
Private Sub officeNavigationBar1_RegisterItem(ByVal sender As Object, ByVal e As DevExpress.XtraBars.Navigation.NavigationBarNavigationClientItemEventArgs)
    e.Item.ImageOptions.SvgImageSize = New Size(24, 24)
    e.Item.ImageOptions.SvgImage = (TryCast(e.NavigationItem, AccordionControlElement)).ImageOptions.SvgImage
End Sub

See Also

AllowItemSelection

Items

NavBarControl

Groups

ActiveGroup

Views

OfficeNavigationBar Class

OfficeNavigationBar Members

DevExpress.XtraBars.Navigation Namespace