Class MessageTemplateContext
Provides the context for the MessageTemplate tag in SfChatUI,
to customize the appearance and styling of each chat message.
Inherited Members
Namespace: Syncfusion.Blazor.InteractiveChat
Assembly: Syncfusion.Blazor.dll
Syntax
public class MessageTemplateContext
Remarks
This context object is passed to the MessageTemplate parameter of SfChatUI.
- Message – The ChatMessage instance containing the message details.
- Index – The zero-based index of this message within the collection (–1 if not set).
Examples
<SfChatUI>
<MessageTemplate>
<!-- Custom template rendering for message-->
</div>
</MessageTemplate>
</SfChatUI>
Constructors
MessageTemplateContext()
Declaration
public MessageTemplateContext()
Properties
Index
Gets or sets the index of the message in the SfChatUI component.
Declaration
public int Index { get; set; }
Property Value
| Type | Description |
|---|---|
| int | An int representing the index of the message. The default value is |
Remarks
This property indicates the position of the message within the list of messages, allowing for easy reference to specific message items.
Message
Gets or sets the chat message data in the SfChatUI component.
Declaration
public ChatMessage Message { get; set; }
Property Value
| Type | Description |
|---|---|
| ChatMessage | A ChatMessage representing the message content. The default value is |
Remarks
This property contains the details of the chat message being rendered in the SfChatUI component.