In This Article

BadgeAdorner Class

Defines attached properties for displaying a Badge as an adornment to a FrameworkElement.

public class BadgeAdorner : Adorner
Inheritance:
object Visual UIElement FrameworkElement Adorner object

Constructors

BadgeAdorner(FrameworkElement, Badge)

Initializes a new instance of the class.

public BadgeAdorner(FrameworkElement adorned, Badge badge)
Parameter Type Description
adorned FrameworkElement

The element to be adorned with a badge.

badge Badge

The badge to be used as the adornment.

Exceptions

Type Condition
ArgumentNullException

Thrown when any argument is null.

Properties

VisualChildrenCount

Gets the number of visual child elements within this element.

protected override int VisualChildrenCount { get; }

Property Value

int:

The number of visual child elements for this element.

Methods

ArrangeOverride(Size)

When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.

protected override Size ArrangeOverride(Size finalSize)
Parameter Type Description
finalSize Size

The final area within the parent that this element should use to arrange itself and its children.

Returns

Size:

The actual size used.

GetVisualChild(int)

Overrides GetVisualChild(int), and returns a child at the specified index from a collection of child elements.

protected override Visual GetVisualChild(int index)
Parameter Type Description
index int

The zero-based index of the requested child element in the collection.

Returns

Visual:

The requested child element. This should not return null; if the provided index is out of range, an exception is thrown.

MeasureOverride(Size)

Implements any custom measuring behavior for the adorner.

protected override Size MeasureOverride(Size constraint)
Parameter Type Description
constraint Size

A size to constrain the adorner to.

Returns

Size:

A System.Windows.Size object representing the amount of layout space needed by the adorner.