New to Telerik UI for WPFStart a free 30-day trial

A content control which is attached to an element and usually displays a status, warning, note, count information related to the attached element.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
[TelerikToolboxCategory("Common")]
public class RadBadge : ContentControl

Inheritance: objectRadBadge

Constructors

Initializes a new instance of the RadBadge class.

C#
public RadBadge()

Fields

AnchorPositionProperty

DependencyProperty

Identifies the AnchorPosition dependency property.

C#
public static readonly DependencyProperty AnchorPositionProperty

BadgeProperty

DependencyProperty

Identifies the Badge attached property.

C#
public static readonly DependencyProperty BadgeProperty

BadgeTypeProperty

DependencyProperty

Identifies the BadgeType dependency property.

C#
public static readonly DependencyProperty BadgeTypeProperty

GeometryProperty

DependencyProperty

Identifies the Geometry dependency property.

C#
public static readonly DependencyProperty GeometryProperty

InheritDataContextProperty

DependencyProperty

Identifies the InheritDataContext dependency property.

C#
public static readonly DependencyProperty InheritDataContextProperty

Identifies the PlayChangeAnimationCommand dependency property.

C#
public static readonly DependencyProperty PlayChangeAnimationCommandProperty

PositionProperty

DependencyProperty

Identifies the Position dependency property.

C#
public static readonly DependencyProperty PositionProperty

StrokeDashArrayProperty

DependencyProperty

Identifies the StrokeDashArray dependency property.

C#
public static readonly DependencyProperty StrokeDashArrayProperty

StrokeProperty

DependencyProperty

Identifies the Stroke dependency property.

C#
public static readonly DependencyProperty StrokeProperty

StrokeThicknessProperty

DependencyProperty

Identifies the StrokeThickness dependency property.

C#
public static readonly DependencyProperty StrokeThicknessProperty

TextAlignmentProperty

DependencyProperty

Identifies the TextAlignment dependency property.

C#
public static readonly DependencyProperty TextAlignmentProperty

Properties

Gets or sets the anchor position of the badge, relative to the size of the badge control. When you set the Position property, consider you move this anchor position. Default value is (0.5, 0.5) meaning the center point of the badge is used for positioning it relatively to the element.

C#
public Point AnchorPosition { get; set; }

Gets or sets the badge type.

C#
public BadgeType BadgeType { get; set; }
Property Value:

A BadgeType value that determines the visual representation of the badge.

Remarks:

The following values are supported: Default (the default badge appearance), DotOnly (only a dot is displayed), Available (indicates available status), DoNotDisturb (indicates do not disturb status), Rejected (indicates rejected status), Remove (indicates removal status), Offline (indicates offline status), Away (indicates away status), OutOfOffice (indicates out of office status), Add (indicates add status), and ContentOnly (displays no badge).

Geometry

Geometry

Gets or sets the geometry of the badge.

C#
public Geometry Geometry { get; set; }

Gets or sets a value indicating whether the badge should take the data context from its target element.

C#
public bool InheritDataContext { get; set; }

Gets or sets the PlayChangeAnimation command.

C#
public DelegateCommand PlayChangeAnimationCommand { get; set; }

Gets or sets the relative position of the badge to the element it is attached to.

C#
public Point Position { get; set; }

Stroke

Brush

Gets or sets the Stroke of the Geometry of the Badge control.

C#
public Brush Stroke { get; set; }

StrokeDashArray

DoubleCollection

Gets or sets the stroke dash array of the badge.

C#
public DoubleCollection StrokeDashArray { get; set; }

Gets or sets the stroke thickness of the badge.

C#
public double StrokeThickness { get; set; }

TextAlignment

TextAlignment

Gets or sets the text alignment of the underlying TextBlock.

C#
public TextAlignment TextAlignment { get; set; }
Property Value:

A TextAlignment value that determines how text is aligned within the badge's content area.

Remarks:

The following values are supported: (text is aligned to the left edge), (text is centered within the available space), (text is aligned to the right edge), and (text is stretched to fit both edges, creating equal spacing between words).

Methods

Gets the attached badge control of the element.

C#
public static RadBadge GetBadge(DependencyObject obj)
Parameters:objDependencyObjectReturns:

RadBadge

C#
protected override Size MeasureOverride(Size constraint)
Parameters:constraintSizeReturns:

Size

C#
public override void OnApplyTemplate()

Called when change animation is about to play.

C#
protected virtual void OnChangeAnimationRequested()

Creates a RadBadgeAutomationPeer.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

Raises the event. This method is invoked whenever is set to true internally.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

Called when play animation is about to play.

C#
protected virtual void OnLoadAnimationRequested()
C#
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters:eDependencyPropertyChangedEventArgs

Sets the attached badge control of the element.

C#
public static void SetBadge(DependencyObject obj, RadBadge value)
Parameters:objDependencyObjectvalueRadBadge