Skip to main content

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

Badge.HorizontalAlignment Property

Gets or sets the BadgeControl‘s horizontal alignment. This is a dependency property.

Namespace: DevExpress.Xpf.Core

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

NuGet Package: DevExpress.Wpf.Core

#Declaration

public HorizontalAlignment HorizontalAlignment { get; set; }

#Property Value

Type Default Description
HorizontalAlignment Right

A HorizontalAlignment enumeration value that specifies the badge’s horizontal alignment.

#Remarks

The following table lists the combinations of the Badge.HorizontalAlignment and Badge.HorizontalAnchor values:

 

HorizontalAnchor

HorizontalAlignment

Left

Center

Right

Stretch

Left

WPF Badges - HorizontalAlignment.Left and HorizontalAnchor.Left

WPF Badges - HorizontalAlignment.Left and HorizontalAnchor.Center

WPF Badges - HorizontalAlignment.Left and HorizontalAnchor.Right

WPF Badges - HorizontalAlignment.Left and HorizontalAnchor.Stretch

Center

WPF Badges - HorizontalAlignment.Center and HorizontalAnchor.Left

WPF Badges - HorizontalAlignment.Center and HorizontalAnchor.Center

WPF Badges - HorizontalAlignment.Center and HorizontalAnchor.Right

WPF Badges - HorizontalAlignment.Center and HorizontalAnchor.Stretch

Right

WPF Badges - HorizontalAlignment.Right and HorizontalAnchor.Left

WPF Badges - HorizontalAlignment.Right and HorizontalAnchor.Center

WPF Badges - HorizontalAlignment.Right and HorizontalAnchor.Right

WPF Badges - HorizontalAlignment.Right and HorizontalAnchor.Stretch

Stretch

WPF Badges - HorizontalAlignment.Stretch and HorizontalAnchor.Left

WPF Badges - HorizontalAlignment.Stretch and HorizontalAnchor.Center

WPF Badges - HorizontalAlignment.Stretch and HorizontalAnchor.Right

WPF Badges - HorizontalAlignment.Stretch and HorizontalAnchor.Stretch

Note

When the Badge.HorizontalAlignment property is Stretch, the Badge.HorizontalAnchor property is ignored.

The following code sample sets the Badge.HorizontalAlignment and Badge.HorizontalAnchor properties to Left:

<dx:SimpleButton ...>
  <dx:Badge.Badge>
    <dx:Badge Content="10" HorizontalAlignment="Left" HorizontalAnchor="Left" />
  </dx:Badge.Badge>
</dx:SimpleButton>
See Also