RadBadge
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:
[TelerikToolboxCategory("Common")]
public class RadBadge : ContentControl
Inheritance: objectRadBadge
Constructors
Initializes a new instance of the RadBadge class.
public RadBadge()
Fields
AnchorPositionProperty
DependencyProperty
Identifies the AnchorPosition dependency property.
public static readonly DependencyProperty AnchorPositionProperty
BadgeProperty
DependencyProperty
Identifies the Badge attached property.
public static readonly DependencyProperty BadgeProperty
BadgeTypeProperty
DependencyProperty
Identifies the BadgeType dependency property.
public static readonly DependencyProperty BadgeTypeProperty
GeometryProperty
DependencyProperty
Identifies the Geometry dependency property.
public static readonly DependencyProperty GeometryProperty
InheritDataContextProperty
DependencyProperty
Identifies the InheritDataContext dependency property.
public static readonly DependencyProperty InheritDataContextProperty
PlayChangeAnimationCommandProperty
DependencyProperty
Identifies the PlayChangeAnimationCommand dependency property.
public static readonly DependencyProperty PlayChangeAnimationCommandProperty
PositionProperty
DependencyProperty
Identifies the Position dependency property.
public static readonly DependencyProperty PositionProperty
StrokeDashArrayProperty
DependencyProperty
Identifies the StrokeDashArray dependency property.
public static readonly DependencyProperty StrokeDashArrayProperty
StrokeProperty
DependencyProperty
Identifies the Stroke dependency property.
public static readonly DependencyProperty StrokeProperty
StrokeThicknessProperty
DependencyProperty
Identifies the StrokeThickness dependency property.
public static readonly DependencyProperty StrokeThicknessProperty
TextAlignmentProperty
DependencyProperty
Identifies the TextAlignment dependency property.
public static readonly DependencyProperty TextAlignmentProperty
Properties
AnchorPosition
Point
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.
public Point AnchorPosition { get; set; }
Gets or sets the badge type.
public BadgeType BadgeType { get; set; }
A BadgeType value that determines the visual representation of the badge.
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.
public Geometry Geometry { get; set; }
Gets or sets a value indicating whether the badge should take the data context from its target element.
public bool InheritDataContext { get; set; }
Gets or sets the PlayChangeAnimation command.
public DelegateCommand PlayChangeAnimationCommand { get; set; }
Position
Point
Gets or sets the relative position of the badge to the element it is attached to.
public Point Position { get; set; }
Stroke
Brush
Gets or sets the Stroke of the Geometry of the Badge control.
public Brush Stroke { get; set; }
StrokeDashArray
DoubleCollection
Gets or sets the stroke dash array of the badge.
public DoubleCollection StrokeDashArray { get; set; }
Gets or sets the stroke thickness of the badge.
public double StrokeThickness { get; set; }
TextAlignment
TextAlignment
Gets or sets the text alignment of the underlying TextBlock.
public TextAlignment TextAlignment { get; set; }
A TextAlignment value that determines how text is aligned within the badge's content area.
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.
public static RadBadge GetBadge(DependencyObject obj)
protected override Size MeasureOverride(Size constraint)
Size
public override void OnApplyTemplate()
Called when change animation is about to play.
protected virtual void OnChangeAnimationRequested()
OnCreateAutomationPeer()
AutomationPeer
Creates a RadBadgeAutomationPeer.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
Called when play animation is about to play.
protected virtual void OnLoadAnimationRequested()
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Sets the attached badge control of the element.
public static void SetBadge(DependencyObject obj, RadBadge value)