Skip to main content
A newer version of this page is available. .
Bar

BarItem.Badge Property

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

Namespace: DevExpress.Xpf.Bars

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

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