Class ThreadMessage
ThreadMessage UI element. Displays a single message within a thread.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class ThreadMessage : BaseVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder
Constructors
ThreadMessage()
Default constructor.
Declaration
public ThreadMessage()
Fields
actionButtonUssClassName
The ThreadMessage action Button styling class.
Declaration
public const string actionButtonUssClassName = "appui-thread-message__action-button"
Field Value
| Type | Description |
|---|---|
| string |
actionsOpenUssClassName
The ThreadMessage actions-open modifier styling class.
Declaration
public const string actionsOpenUssClassName = "appui-thread-message--actions-open"
Field Value
| Type | Description |
|---|---|
| string |
actionsUssClassName
The ThreadMessage actions styling class.
Declaration
public const string actionsUssClassName = "appui-thread-message__actions"
Field Value
| Type | Description |
|---|---|
| string |
attachmentsUssClassName
The ThreadMessage attachments styling class.
Declaration
public const string attachmentsUssClassName = "appui-thread-message__attachments"
Field Value
| Type | Description |
|---|---|
| string |
authorNameUssClassName
The ThreadMessage author name styling class.
Declaration
public const string authorNameUssClassName = "appui-thread-message__author-name"
Field Value
| Type | Description |
|---|---|
| string |
avatarUssClassName
The ThreadMessage avatar styling class.
Declaration
public const string avatarUssClassName = "appui-thread-message__avatar"
Field Value
| Type | Description |
|---|---|
| string |
bodyUssClassName
The ThreadMessage body styling class.
Declaration
public const string bodyUssClassName = "appui-thread-message__body"
Field Value
| Type | Description |
|---|---|
| string |
contentContainerUssClassName
The ThreadMessage content container styling class.
Declaration
public const string contentContainerUssClassName = "appui-thread-message__content-container"
Field Value
| Type | Description |
|---|---|
| string |
contentUssClassName
The ThreadMessage content styling class.
Declaration
public const string contentUssClassName = "appui-thread-message__content"
Field Value
| Type | Description |
|---|---|
| string |
dislikeBtnUssClassName
The ThreadMessage dislike button styling class.
Declaration
public const string dislikeBtnUssClassName = "appui-thread-message__dislike-btn"
Field Value
| Type | Description |
|---|---|
| string |
footerUssClassName
The ThreadMessage footer styling class.
Declaration
public const string footerUssClassName = "appui-thread-message__footer"
Field Value
| Type | Description |
|---|---|
| string |
headerUssClassName
The ThreadMessage header styling class.
Declaration
public const string headerUssClassName = "appui-thread-message__header"
Field Value
| Type | Description |
|---|---|
| string |
likeBtnUssClassName
The ThreadMessage like button styling class.
Declaration
public const string likeBtnUssClassName = "appui-thread-message__like-btn"
Field Value
| Type | Description |
|---|---|
| string |
metaUssClassName
The ThreadMessage meta styling class.
Declaration
public const string metaUssClassName = "appui-thread-message__meta"
Field Value
| Type | Description |
|---|---|
| string |
reactionsUssClassName
The ThreadMessage reactions styling class.
Declaration
public const string reactionsUssClassName = "appui-thread-message__reactions"
Field Value
| Type | Description |
|---|---|
| string |
stateUssClassName
The ThreadMessage state modifier styling class.
Declaration
public const string stateUssClassName = "appui-thread-message--"
Field Value
| Type | Description |
|---|---|
| string |
timestampUssClassName
The ThreadMessage timestamp styling class.
Declaration
public const string timestampUssClassName = "appui-thread-message__timestamp"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The ThreadMessage main styling class.
Declaration
public const string ussClassName = "appui-thread-message"
Field Value
| Type | Description |
|---|---|
| string |
Properties
attachments
The attachments container. Add attachment elements to this container to have them displayed in the message attachments area.
Declaration
public VisualElement attachments { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
authorAvatar
The avatar background image for the message author.
Declaration
public Background authorAvatar { get; set; }
Property Value
| Type | Description |
|---|---|
| Background |
authorAvatarColor
The background color of the avatar.
Declaration
public Optional<Color> authorAvatarColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Optional<Color> |
authorInitials
The initials text displayed inside the avatar when no image is set.
Declaration
public string authorInitials { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
authorName
The author name displayed in the message header.
Declaration
public string authorName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
contentContainer
The container for the message. Use this to add a composer in draft mode.
Declaration
public override VisualElement contentContainer { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
Overrides
dislikeCount
The number of dislikes displayed on the dislike button.
Declaration
public int dislikeCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
isDisliked
Whether the dislike button is in a selected (highlighted) state.
Declaration
public bool isDisliked { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
isLiked
Whether the like button is in a selected (highlighted) state.
Declaration
public bool isLiked { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
likeCount
The number of likes displayed on the like button.
Declaration
public int likeCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
makeActionMenuItems
Callback to populate the action menu when the action button is clicked.
When set, the action button is visible; when null, it is hidden.
Declaration
public Action<ThreadMessage, MenuBuilder> makeActionMenuItems { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<ThreadMessage, MenuBuilder> |
message
The rich text content of the message body.
Declaration
public string message { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
reactions
The list of reactions to display on the message.
Declaration
public IList<ReactionInfo> reactions { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<ReactionInfo> |
state
The state of the message. Adds a modifier class using the -- pattern.
Declaration
public ThreadMessageState state { get; set; }
Property Value
| Type | Description |
|---|---|
| ThreadMessageState |
timestamp
The timestamp text displayed in the message header.
Declaration
public string timestamp { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
timestampTooltip
The tooltip displayed on the timestamp element.
Declaration
public string timestampTooltip { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetStateUssClassName(ThreadMessageState)
Declaration
public static string GetStateUssClassName(ThreadMessageState enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| ThreadMessageState | enumValue |
Returns
| Type | Description |
|---|---|
| string |
Events
dislikeToggled
Event invoked when the dislike button is toggled.
Declaration
public event Action<bool> dislikeToggled
Event Type
| Type | Description |
|---|---|
| Action<bool> |
likeToggled
Event invoked when the like button is toggled.
Declaration
public event Action<bool> likeToggled
Event Type
| Type | Description |
|---|---|
| Action<bool> |
reactionToggled
Event invoked when a reaction is toggled.
Declaration
public event Action<string, bool> reactionToggled
Event Type
| Type | Description |
|---|---|
| Action<string, bool> |