Skip to main content
Version: 4.2

Avatar

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.2.0.0)

Displays an image or generated initials, a presence indicator, and optional inline labels.

public class Avatar : Control

AvatarSize is the portrait diameter in pixels; the inherited Size controls the entire surface including labels. Text uses the first grapheme of the first and last name. Empty names display a neutral placeholder. Failed images fall back to initials. Image instances remain owned by the caller.

Example:

var avatar = new Avatar {
Text = "Saoirse Kovač", Label = "Saoirse Kovač", SubLabel = "Finance",
Presence = AvatarPresence.Online, AvatarSize = (int)AvatarSizePreset.M,
Size = new Size(280, 48)
};
avatar.Click += (s, e) => MessageBox.Show(avatar.Text);
Controls.Add(avatar);

Constructors​

Instance member Avatar()​

Creates a focusable portrait with a 40 pixel diameter.

Properties​

Instance member AutoColor​

Boolean: Gets or sets whether a deterministic color is chosen from Text. (Default: True)

Instance member AvatarSize​

Int32: Gets or sets the portrait diameter, from 16 to 256 pixels. The default is 40. (Default: 40)

Use AvatarSizePreset values cast to int for standard sizes. This does not change the inherited control Size.

Instance member AwayText​

String: Gets or sets the localized override for the "away" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Instance member BusyText​

String: Gets or sets the localized override for the "busy" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Protected member DefaultSize​

Size: Gets the default 40 by 40 control size.

Instance member Image​

Image: Gets or sets the image displayed in preference to ImageSource. The caller retains ownership. (Default: null)

Instance member ImageSource​

String: Gets or sets a Wisej image source, URL, or theme image name. (Default: "")

Instance member Label​

String: Gets or sets the primary label displayed beside the portrait. (Default: "")

Instance member OfflineText​

String: Gets or sets the localized override for the "offline" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Instance member OnlineText​

String: Gets or sets the localized override for the "online" text. (Default: null)

The default is null, which selects the built-in translation for the current UI culture. The getter returns the configured override. An empty string suppresses the text without changing the operation.

Instance member Presence​

AvatarPresence: Gets or sets the presence indicator. (Default: None)

Instance member Shape​

AvatarShape: Gets or sets the outline shape. (Default: Circle)

Instance member SubLabel​

String: Gets or sets the secondary label displayed beside the portrait. (Default: "")

Instance member Text​

String: Gets or sets the name used to derive up to two initials. (Default: "")

Methods​

Protected member OnWebEvent(e)​

Dispatches client activation while suppressing duplicate native taps.

ParameterTypeDescription
eWisejEventArgsClient event.

Protected member OnWebRender(config)​

Serializes the portrait and wires activation independently of event subscriptions.

ParameterTypeDescription
configObjectClient configuration.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.