Skip to main content
Bar

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

BarItem.Badge Property

Gets or sets the BarItem’s BadgeControl. This is a dependency property.

Namespace: DevExpress.Xpf.Bars

Assembly: DevExpress.Xpf.Core.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

public Badge Badge { get; set; }

#Property Value

Type Description
Badge

The badge.

#Remarks

If the BarItem.Glyph property is not empty, a BadgeControl is displayed in the glyph area:

WPF BarItem - Badge with Glyph

If the BarItem.Glyph is empty, a BadgeControl is displayed in the content area:

WPF BarItem - Badge without Glyph

#Code Sample

The following code sample displays a BarButtonItem with a BadgeControl:

WPF BarItem - Badge property

<dx:ThemedWindow 
  ...
  xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
  xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars">
  ...
    <dxb:ToolBarControl>
      <dxb:BarButtonItem Content="Mail" Glyph="{dx:DXImage SvgImages/Outlook Inspired/Glyph_Mail.svg}" GlyphSize="Large">
        <dxb:BarButtonItem.Badge>
          <dx:Badge Content="12"/>
        </dxb:BarButtonItem.Badge>
      </dxb:BarButtonItem>
    </dxb:ToolBarControl>
  ...
</dx:ThemedWindow>
See Also