Skip to main content

NavButton Class

Represents a button in the TileNavPane‘s nav bar.

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public class NavButton :
    NavElement,
    ITileNavButton,
    ISupportCommandBinding

Remarks

The TileNavPane‘s nav bar can display NavButtons that can preform a custom action on a click. Handle the NavElement.ElementClick event to respond to a click on a certain NavButton. The following figure shows an example of the nav bar that displays the Main Button and two custom NavButtons.

TileNavPane_NavBarElements

These buttons are contained in the TileNavPane.Buttons collection along with custom TileNavCategory objects (when added to this collection categories are rendered as nav bar buttons). You can specify the alignment of a NavButton within the nav bar with the NavElement.Alignment property. The actual button alignment is dependent on the alignment of the preceding buttons. See NavElement.Alignment for details.

The TileNavPane can contain one Main Button that provides access to the top-level elements of the navigation hierarchy. The Main Button is a NavButton instance, whose NavButton.IsMain property is set to true. On a Main Button click, the TileNavPane displays the primary drop-down tile bar. This drop-down contains tiles representing categories (TileNavPane.Categories) or tiles representing the default category’s items (TileNavPane.DefaultCategory). This behavior is controlled by the TileNavPane.MainButtonBehavior property.

When a TileNavPane is created at design time by dropping it on a form from the Toolbox, the Main Button is created automatically and is displayed at the leftmost position in the nav bar. If you create a TileNavPane in code, you need to manually create the Main Button. To do this, create an instance of the NavButton class, set the NavButton.IsMain property to true and add it to the TileNavPane.Buttons collection. Only one NavButton can be the Main Button. Setting the NavButton.IsMain property of a NavButton to true resets this property of the previously specified Main Button to false.

The breadcrumbs navigation aid, which allows an end-user to keep track of his/her location in the navigation hierarchy, is displayed to the right of the Main Button. Note that the breadcrumbs’ links are not contained in the TileNavPane.Buttons collection.

Implements

See Also