Struct UserIdentity
The minimum a UI needs to draw a person.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public struct UserIdentity : IEquatable<UserIdentity>
Remarks
Modelled after the registry's UserIdentity: an id that is always present, plus a
name, portrait and color that may still be resolving.
An initials avatar can render from id and color alone, before a
directory lookup returns the display name.
color is a colour the host supplies, typically derived from a stable hash of the person so they keep one colour everywhere, including outside UI Toolkit. It deliberately does not come from the theme: it identifies a person, not a surface.
Fields
color
The person's identity colour, used as the initials backdrop. Not a theme colour.
Declaration
public Optional<Color> color
Field Value
| Type | Description |
|---|---|
| Optional<Color> |
id
A stable identifier for the person. Always present.
Declaration
public string id
Field Value
| Type | Description |
|---|---|
| string |
name
The display name, if it has resolved yet. Drives the initials.
Declaration
public string name
Field Value
| Type | Description |
|---|---|
| string |
portrait
The profile image, if the person has one. Takes precedence over the initials.
Declaration
public Background portrait
Field Value
| Type | Description |
|---|---|
| Background |
Methods
Equals(object)
Compares this identity with an arbitrary object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with. |
Returns
| Type | Description |
|---|---|
| bool | True if |
Overrides
Equals(UserIdentity)
Compares two identities field by field.
Declaration
public bool Equals(UserIdentity other)
Parameters
| Type | Name | Description |
|---|---|---|
| UserIdentity | other | The other identity. |
Returns
| Type | Description |
|---|---|
| bool | True if every field matches. |
GetHashCode()
Returns a hash code for this identity.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code. |