Events in Blazor Chat UI component
17 Dec 20241 minute to read
This section describes the Chat UI events that will be triggered when appropriate actions are performed. The following events are available in the Chat UI component.
Created
The Chat UI component triggers the Created event when the component rendering is completed.
@using Syncfusion.Blazor.InteractiveChat
<div style="height: 400px; width: 400px;">
<SfChatUI Created="Created"></SfChatUI>
</div>
@code {
private void Created()
{
// Your required action here
}
}
Sending message
The MessageSend event is triggered when the message is being sent in the Chat UI component.
@using Syncfusion.Blazor.InteractiveChat
<div style="height: 400px; width: 400px;">
<SfChatUI MessageSend="MessageSend"></SfChatUI>
</div>
@code {
private void MessageSend(ChatMessageSendEventArgs args)
{
// Your required action here
}
}
User typing
The UserTyping event is triggered when the user is typing a message in the Chat UI component.
@using Syncfusion.Blazor.InteractiveChat
<div style="height: 400px; width: 400px;">
<SfChatUI UserTyping="UserTyping"></SfChatUI>
</div>
@code {
private void UserTyping(ChatUserTypingEventArgs args)
{
// Your required action here
}
}