Class AvatarGroup
AvatarGroup UI element.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class AvatarGroup : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder
Constructors
AvatarGroup()
Defines the AvatarGroup constructor.
Declaration
public AvatarGroup()
Fields
spacingUssClassName
The AvatarGroup spacing styling class.
Declaration
public const string spacingUssClassName = "appui-avatar-group--spacing-"
Field Value
Type | Description |
---|---|
string |
surplusUssClassName
The AvatarGroup surplus styling class.
Declaration
public const string surplusUssClassName = "appui-avatar-group__surplus"
Field Value
Type | Description |
---|---|
string |
ussClassName
The AvatarGroup main styling class.
Declaration
public const string ussClassName = "appui-avatar-group"
Field Value
Type | Description |
---|---|
string |
Properties
bindItem
Method used to bind an item to a child Avatar.
Declaration
public Action<Avatar, int> bindItem { get; set; }
Property Value
Type | Description |
---|---|
Action<Avatar, int> |
contentContainer
The AvatarGroup content container.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Overrides
max
The maximum number of avatars to display before the overflow.
Declaration
public int max { get; set; }
Property Value
Type | Description |
---|---|
int |
renderSurplus
The custom render function for the surplus avatars.
Declaration
public AvatarGroup.RenderSurplusDelegate renderSurplus { get; set; }
Property Value
Type | Description |
---|---|
AvatarGroup.RenderSurplusDelegate |
size
The size of avatars.
Declaration
public Size size { get; set; }
Property Value
Type | Description |
---|---|
Size |
sourceItems
The collection of items that will be displayed as Radio component.
Declaration
public IList sourceItems { get; set; }
Property Value
Type | Description |
---|---|
IList |
spacing
The spacing between avatars.
Declaration
public AvatarGroupSpacing spacing { get; set; }
Property Value
Type | Description |
---|---|
AvatarGroupSpacing |
total
The AvatarGroup total count.
Declaration
public int total { get; }
Property Value
Type | Description |
---|---|
int |
variant
The AvatarGroup variant.
Declaration
public AvatarVariant variant { get; set; }
Property Value
Type | Description |
---|---|
AvatarVariant |
Methods
GetDefaultSurplusElement(int)
The default surplus VisualElement.
Declaration
public static VisualElement GetDefaultSurplusElement(int surplus)
Parameters
Type | Name | Description |
---|---|---|
int | surplus | The number of surplus avatars. |
Returns
Type | Description |
---|---|
VisualElement | The default surplus VisualElement. |
GetSpacingUssClassName(AvatarGroupSpacing)
Declaration
public static string GetSpacingUssClassName(AvatarGroupSpacing enumValue)
Parameters
Type | Name | Description |
---|---|---|
AvatarGroupSpacing | enumValue |
Returns
Type | Description |
---|---|
string |
Refresh()
Refresh the AvatarGroup.
Declaration
public void Refresh()
SetCustomTotal(int?)
Set a custom AvatarGroup total count instead of the child count.
Declaration
public void SetCustomTotal(int? customTotal)
Parameters
Type | Name | Description |
---|---|---|
int? | customTotal | The custom total count. |
Remarks
You can pass a null value to reset the custom total count and use the child count instead.