Class ChatMessage
Represents a message in the SfChatUI component.
Inheritance
Namespace: Syncfusion.Blazor.InteractiveChat
Assembly: Syncfusion.Blazor.dll
Syntax
public class ChatMessage : Object
Remarks
This class is used to define messages displayed in the Chat UI component, including properties for message content, timestamp, sender, and status.
Constructors
ChatMessage()
Declaration
public ChatMessage()
Properties
Author
Gets or sets the user who sent the chat message in the SfChatUI component.
Declaration
public UserModel Author { get; set; }
Property Value
Type | Description |
---|---|
UserModel | A UserModel representing the sender. The default value is |
Remarks
This property identifies the user who authored the message, allowing messages to be associated with specific participants.
ID
Gets or sets the unique identifier for the chat message in the SfChatUI component.
Declaration
public string ID { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the unique identifier. The default value is System.String.Empty. |
Remarks
This property ensures each message in the SfChatUI component can be uniquely identified.
Status
Gets or sets the status of the chat message in the SfChatUI component.
Declaration
public MessageStatusModel Status { get; set; }
Property Value
Type | Description |
---|---|
MessageStatusModel | A MessageStatusModel representing the current message status (e.g., sent, delivered, read). The default value is |
Remarks
This property indicates the message's status, enhancing communication clarity by showing whether a message has been sent, delivered, or read.
Text
Gets or sets the content of the chat message in the SfChatUI component.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the message content. The default value is System.String.Empty. |
Remarks
This property contains the main text of the chat message displayed to users.
Timestamp
Gets or sets the date and time for the message in the SfChatUI component.
Declaration
public Nullable<DateTime> Timestamp { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | A System.DateTime representing the timestamp of the message. |
Remarks
This property provides temporal context for each message, aiding in chronological organization within the chat.
TimestampFormat
Gets or sets the format for displaying the timestamp in chat messages.
Declaration
public string TimestampFormat { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String representing the timestamp format. The default value is System.String.Empty. |
Remarks
This property defines the display format for the message timestamp, allowing customization per locale or user preference.