Skip to main content
Bar

BarItem.Badge Property

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

Namespace: DevExpress.Xpf.Bars

Assembly: DevExpress.Xpf.Core.v22.1.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