Class
TelerikChat<TItem>

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Type Parameters:

TItem

Syntax:

cs-api-definition
public class TelerikChat<TItem> : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikChat<TItem>

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members BaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)

Constructors

TelerikChat()

Declaration

cs-api-definition
public TelerikChat()

Properties

AuthorId

Defines the ID of the current author/user. Set this to the ID of the user who is currently sending messages. Each message in the chat should have an AuthorId that matches this value to indicate that the message was sent by the current user.

Declaration

cs-api-definition
[Parameter]
public string AuthorId { get; set; }

Property Value

string

AuthorIdField

Defines the field in the data source that contains the ID of the author of the message.

Declaration

cs-api-definition
[Parameter]
public string AuthorIdField { get; set; }

Property Value

string

AuthorImageAltTextField

Defines the field in the data source that contains the alt text for the author's image.

Declaration

cs-api-definition
[Parameter]
public string AuthorImageAltTextField { get; set; }

Property Value

string

AuthorImageUrlField

Defines the field in the data source that contains the image URL of the author of the message.

Declaration

cs-api-definition
[Parameter]
public string AuthorImageUrlField { get; set; }

Property Value

string

AuthorNameField

Defines the field in the data source that contains the name of the author of the message.

Declaration

cs-api-definition
[Parameter]
public string AuthorNameField { get; set; }

Property Value

string

ChatFileActions

Defines a render fragment that contains actions for the attachments. Children: ChatFileAction.

Declaration

cs-api-definition
[Parameter]
public RenderFragment ChatFileActions { get; set; }

Property Value

RenderFragment

ChatMessageContextMenuActions

Defines a render fragment that contains message actions. Children: ChatMessageContextMenuAction.

Declaration

cs-api-definition
[Parameter]
public RenderFragment ChatMessageContextMenuActions { get; set; }

Property Value

RenderFragment

ChatMessageToolbarActions

Defines a render fragment that contains actions for the attachments. Children: ChatMessageToolbarAction.

Declaration

cs-api-definition
[Parameter]
public RenderFragment ChatMessageToolbarActions { get; set; }

Property Value

RenderFragment

ChatSettings

Defines a render fragment that contains all settings for the Chat. Children: ChatFileSelectSettings, ChatSpeechToTextButtonSettings.

Declaration

cs-api-definition
[Parameter]
public RenderFragment ChatSettings { get; set; }

Property Value

RenderFragment

Data

The data source for the chat component. The data source should be a collection of items that represent messages.

Declaration

cs-api-definition
[Parameter]
public IEnumerable<TItem> Data { get; set; }

Property Value

IEnumerable<TItem>

EnableFileUpload

Enables or disables the file upload functionality in the chat component. Renders a file upload icon in the chat input box that allows users to upload files.

Declaration

cs-api-definition
[Parameter]
public bool EnableFileUpload { get; set; }

Property Value

bool

EnableMessageCollapse

Enables the collapse functionality for messages in the chat component. By default, messages are expanded and can be collapsed by clicking on them.

Declaration

cs-api-definition
[Parameter]
public bool EnableMessageCollapse { get; set; }

Property Value

bool

EnableSpeechToText

Enables or disables the speech-to-text functionality in the chat component. Renders a microphone icon in the chat input box that allows users to convert speech to text.

Declaration

cs-api-definition
[Parameter]
public bool EnableSpeechToText { get; set; }

Property Value

bool

FilesField

Defines the field in the data source that contains the attachments of the message. The field should be a collection of objects of type FileSelectFileInfo.

Declaration

cs-api-definition
[Parameter]
public string FilesField { get; set; }

Property Value

string

HeaderTemplate

Template for modifying the content of the header of the chat component.

Declaration

cs-api-definition
[Parameter]
public RenderFragment HeaderTemplate { get; set; }

Property Value

RenderFragment

Height

Defines the height of the chat component.

Declaration

cs-api-definition
[Parameter]
public string Height { get; set; }

Property Value

string

IdField

Defines the field in the data source that contains the ID of the message.

Declaration

cs-api-definition
[Parameter]
public string IdField { get; set; }

Property Value

string

InputValue

The value of the chat input field.

Declaration

cs-api-definition
[Parameter]
public string InputValue { get; set; }

Property Value

string

IsDeletedField

Defines the field in the data source that indicates whether the message is deleted.

Declaration

cs-api-definition
[Parameter]
public string IsDeletedField { get; set; }

Property Value

string

IsPinnedField

Defines the field in the data source that indicates whether the message is deleted.

Declaration

cs-api-definition
[Parameter]
public string IsPinnedField { get; set; }

Property Value

string

MessageBoxTemplate

A render fragment that allows customization of the whole message box section in the chat.

Declaration

cs-api-definition
[Parameter]
public RenderFragment MessageBoxTemplate { get; set; }

Property Value

RenderFragment

MessageStatusTemplate

Template for modifying the appearance of the message status indicators in the chat.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<ChatMessageStatusTemplateContext<TItem>> MessageStatusTemplate { get; set; }

Property Value

RenderFragment<ChatMessageStatusTemplateContext<TItem>>

MessageTemplate

Template for modifying the appearance of the messages in the chat.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<ChatMessageTemplateContext<TItem>> MessageTemplate { get; set; }

Property Value

RenderFragment<ChatMessageTemplateContext<TItem>>

MessageWidthMode

Defines the width mode of the messages in the chat. The available options are:

  1. Standard - Messages will have a width that fits their content.
  2. Full - Messages will take the full width of the chat container.

The default value is Standard.

Declaration

cs-api-definition
[Parameter]
public MessageWidthMode MessageWidthMode { get; set; }

Property Value

MessageWidthMode

OnDownload

Event callback that is triggered when a file is downloaded. Triggered upon clicking on a file download action or when the Download button is clicked.

Declaration

cs-api-definition
[Parameter]
public EventCallback<ChatDownloadEventArgs> OnDownload { get; set; }

Property Value

EventCallback<ChatDownloadEventArgs>

OnInputValueChanged

Event callback that is triggered when the input value changes.

Declaration

cs-api-definition
[Parameter]
public EventCallback<string> OnInputValueChanged { get; set; }

Property Value

EventCallback<string>

OnMessageUnpin

Event callback that is triggered when a message is unpinned.

Declaration

cs-api-definition
[Parameter]
public EventCallback<ChatMessageUnpinEventArgs> OnMessageUnpin { get; set; }

Property Value

EventCallback<ChatMessageUnpinEventArgs>

OnSendMessage

Event callback that is triggered when a message is sent. The arguments are of type ChatSendMessageEventArgs.

Declaration

cs-api-definition
[Parameter]
public EventCallback<ChatSendMessageEventArgs> OnSendMessage { get; set; }

Property Value

EventCallback<ChatSendMessageEventArgs>

OnSuggestionClick

An event callback that is triggered when a suggestion is selected from the suggestions list. The arguments are of type ChatSuggestionClickEventArgs.

Declaration

cs-api-definition
[Parameter]
public EventCallback<ChatSuggestionClickEventArgs> OnSuggestionClick { get; set; }

Property Value

EventCallback<ChatSuggestionClickEventArgs>

ReplyToIdField

Each meesage in the chat should have a unique ID. This field value is optional and it is used to identify the other meessage to which the current message is a reply.

Declaration

cs-api-definition
[Parameter]
public string ReplyToIdField { get; set; }

Property Value

string

StatusField

Defines the field in the data source that contains the status of the message.

Declaration

cs-api-definition
[Parameter]
public string StatusField { get; set; }

Property Value

string

SuggestedActionsField

Defines the field in the data source that contains the quick actions for the message.

Declaration

cs-api-definition
[Parameter]
public string SuggestedActionsField { get; set; }

Property Value

string

SuggestionTemplate

Template for modifying the appearance of the suggestions displayed in the chat input.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<ChatSuggestionTemplateContext> SuggestionTemplate { get; set; }

Property Value

RenderFragment<ChatSuggestionTemplateContext>

Suggestions

Use this parameter to provide a collection of suggestions that will be displayed as quick reply options in the chat input.

Declaration

cs-api-definition
[Parameter]
public IEnumerable<string> Suggestions { get; set; }

Property Value

IEnumerable<string>

TextField

The field in the data source that contains the text of the message.

Declaration

cs-api-definition
[Parameter]
public string TextField { get; set; }

Property Value

string

TimestampField

Defines the field in the data source that contains the timestamp of the message.

Declaration

cs-api-definition
[Parameter]
public string TimestampField { get; set; }

Property Value

string

TimestampTemplate

Defines a render fragment that contains the content of the chat time stamps displayed between messages.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<ChatTimestampTemplateContext> TimestampTemplate { get; set; }

Property Value

RenderFragment<ChatTimestampTemplateContext>

Width

Defines the width of the chat component.

Declaration

cs-api-definition
[Parameter]
public string Width { get; set; }

Property Value

string

Methods

AddSendMessageButtonSettings(ChatSendMessageButtonSettings)

Declaration

cs-api-definition
public void AddSendMessageButtonSettings(ChatSendMessageButtonSettings settings)

Parameters

settings

ChatSendMessageButtonSettings

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

Dispose()

Declaration

cs-api-definition
public override void Dispose()

Overrides BaseComponent.Dispose()

OnAfterRenderAsync(bool)

Declaration

cs-api-definition
protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides BaseComponent.OnAfterRenderAsync(bool)

OnParametersSet()

Declaration

cs-api-definition
protected override void OnParametersSet()

Overrides ComponentBase.OnParametersSet()

Refresh()

Refreshes the chat component, causing it to re-render.

Declaration

cs-api-definition
public void Refresh()

RemoveSendMessageButtonSettings()

Declaration

cs-api-definition
public void RemoveSendMessageButtonSettings()