Skip to main content

Default Style

  • 2 minutes to read

The NavBar control provides a set of default styles, which affect the appearance of its elements (background, scroll buttons, group headers, links/items and hint boxes). They are all set via the OptionsStyle.DefaultStyles property of the NavBar control.

The default style determines the appearance of all corresponding NavBar elements. For instance, the OptionsStyle.DefaultStyles.GroupBackground style affects the background of all NavBar groups.

However, you can provide a separate style for individual NavBar elements by using custom styles. For instance, you can provide an individual style for the background of a specific NavBar group. Refer to the Assigning Styles to Elements topic for more.

The following image shows the NavBar control displaying three groups. Custom styles are assigned to the Temp group using the group’s CustomStyles.Background and CustomStyles.Header properties. Other groups are painted according to default style settings.

Default styles are determined by the current View assigned to the control via the View property. Each time a new View is assigned, the OptionsStyle.DefaultStyles property attributes are set according to the View settings. These attributes are hardcoded, which means that changes made to the OptionsStyle.DefaultStyles attributes are temporary and are immediately discarded when a new View is applied.

You can avoid this by assigning custom styles to desired NavBar elements. In this instance, changing the current View influences only those NavBar elements, which were not affected by custom styles.

See Also