Loading...
Loading...
Implements the Syncfusion WPF Badge (SfBadge) component for notification badges and indicators. Use this when adding notification badges to buttons, displaying counts or status indicators, or customizing badge appearance in WPF applications. Covers badge positioning with alignment and anchor properties, color customization with Fill property, shapes, animations, and attachment using SfBadge.Badge property.
npx skill4agent add syncfusion/wpf-ui-components-skills syncfusion-wpf-badge<!-- Basic badge on a button -->
<Button Width="100" Height="50" Content="Inbox">
<notification:SfBadge.Badge>
<notification:SfBadge
Content="10"
Fill="Success"
Shape="Oval"
x:Name="badge"/>
</notification:SfBadge.Badge>
</Button>// C# equivalent
SfBadge sfBadge = new SfBadge();
sfBadge.Name = "badge";
sfBadge.Content = "10";
sfBadge.Fill = BadgeFill.Success;
sfBadge.Shape = BadgeShape.Oval;
Button button = new Button();
button.Width = 100;
button.Height = 50;
button.Content = "Inbox";
SfBadge.SetBadge(button, sfBadge);<!-- Top-right corner (default) -->
<notification:SfBadge
HorizontalAlignment="Right"
VerticalAlignment="Top"
Content="5"/>
<!-- Bottom-left corner -->
<notification:SfBadge
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="3"/><notification:SfBadge
AnimationType="Scale"
Content="{Binding UnreadCount}"
Fill="Error"/><notification:SfBadge
Fill="Information"
Shape="Ellipse"
FontSize="16"
FontStyle="Italic"
Content="NEW"/><ListView ItemsSource="{Binding MailItems}">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding ItemName}"/>
<notification:SfBadge
Content="{Binding UnreadCount}"
Visibility="{Binding HasMessages, Converter={StaticResource BoolToVisibilityConverter}}"
Shape="Oval"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>| Property | Default | Purpose |
|---|---|---|
| null | Badge display text/value |
| Accent | Predefined color state (Success, Error, Warning, etc.) |
| Oval | Badge shape (Oval, Rectangle, Ellipse, None, Custom) |
| Right | Horizontal position (Left, Center, Right, Stretch) |
| Top | Vertical position (Top, Center, Bottom, Stretch) |
| Center | Anchor mode (Inside, Center, Outside, Custom) |
| Center | Anchor mode (Inside, Center, Outside, Custom) |
| None | Animation on content change (Scale, Opacity, None) |
| null | Custom background color (overrides Fill) |
| null | Custom text color |
| 14 | Text size in pixels |
| 1 | Transparency (0-1 range) |
| Visible | Show/hide badge (Visible, Collapsed) |