In This Article

Avatar Class

Renders textual or visual content to represent a user's identity.

public class Avatar : Button
Inheritance:
object Visual UIElement FrameworkElement Control ContentControl ButtonBase Button object

Constructors

Avatar()

Initializes an instance of the class.

public Avatar()

Properties

CornerRadius

Gets or sets the CornerRadius for the control's border.

public CornerRadius CornerRadius { get; set; }

Property Value

CornerRadius:

The CornerRadius for the control's border.

Description

The string description that can derive initials for the Content property, and is also used as tooltip content by default.

public string Description { get; set; }

Property Value

string

Remarks

When the Content property is null, initials will be derived from the description and coerced into the Content property result.

EmptyContentTemplate

The DataTemplate to use when there is no content.

public DataTemplate EmptyContentTemplate { get; set; }

Property Value

DataTemplate

Remarks

The default value renders a generic person glyph.

IsEmpty

Gets a value indicating whether the avatar content is empty.

public bool IsEmpty { get; }

Property Value

bool:

true if the content is empty; otherwise, false.

TextAppearanceKind

A AvatarTextAppearanceKind value indicating how the control's background and foreground appearance can be dynamically changed based on any text assigned to the Content property.

public AvatarTextAppearanceKind TextAppearanceKind { get; set; }

Property Value

AvatarTextAppearanceKind:

The default value is AutomaticSolid.

Methods

ArrangeOverride(Size)

Called to arrange and size the content of a Control object.

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

The computed size that is used to arrange the content.

Returns

Size:

The size of the control.

MeasureOverride(Size)

Called to remeasure a control.

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

The maximum size that the method can return.

Returns

Size:

The size of the control, up to the maximum specified by constraint.

OnCreateAutomationPeer()

Creates an appropriate ButtonAutomationPeer for this control as part of the WPF infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

A ButtonAutomationPeer for this control.

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Fields

CornerRadiusProperty

Identifies the CornerRadius dependency property.

public static readonly DependencyProperty CornerRadiusProperty

DescriptionProperty

Identifies the Description dependency property.

public static readonly DependencyProperty DescriptionProperty

EmptyContentTemplateProperty

Identifies the EmptyContentTemplate dependency property.

public static readonly DependencyProperty EmptyContentTemplateProperty

IsEmptyProperty

Identifies the IsEmpty dependency property.

public static readonly DependencyProperty IsEmptyProperty

TextAppearanceKindProperty

Identifies the TextAppearanceKind dependency property.

public static readonly DependencyProperty TextAppearanceKindProperty