ClassTelerikChat<TItem>
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Type Parameters:
TItem
Syntax:
public class TelerikChat<TItem> : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentTelerikChat<TItem>
Implements:
Inherited Members
Constructors
TelerikChat()
Declaration
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
[Parameter]
public string AuthorId { get; set; }
Property Value
AuthorIdField
Defines the field in the data source that contains the ID of the author of the message.
Declaration
[Parameter]
public string AuthorIdField { get; set; }
Property Value
AuthorImageAltTextField
Defines the field in the data source that contains the alt text for the author's image.
Declaration
[Parameter]
public string AuthorImageAltTextField { get; set; }
Property Value
AuthorImageUrlField
Defines the field in the data source that contains the image URL of the author of the message.
Declaration
[Parameter]
public string AuthorImageUrlField { get; set; }
Property Value
AuthorNameField
Defines the field in the data source that contains the name of the author of the message.
Declaration
[Parameter]
public string AuthorNameField { get; set; }
Property Value
ChatFileActions
Defines a render fragment that contains actions for the attachments. Children: ChatFileAction.
Declaration
[Parameter]
public RenderFragment ChatFileActions { get; set; }
Property Value
ChatMessageContextMenuActions
Defines a render fragment that contains message actions. Children: ChatMessageContextMenuAction.
Declaration
[Parameter]
public RenderFragment ChatMessageContextMenuActions { get; set; }
Property Value
ChatMessageToolbarActions
Defines a render fragment that contains actions for the attachments. Children: ChatMessageToolbarAction.
Declaration
[Parameter]
public RenderFragment ChatMessageToolbarActions { get; set; }
Property Value
ChatSettings
Defines a render fragment that contains all settings for the Chat. Children: ChatFileSelectSettings, ChatSpeechToTextButtonSettings.
Declaration
[Parameter]
public RenderFragment ChatSettings { get; set; }
Property Value
Data
The data source for the chat component. The data source should be a collection of items that represent messages.
Declaration
[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
[Parameter]
public bool EnableFileUpload { get; set; }
Property Value
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
[Parameter]
public bool EnableMessageCollapse { get; set; }
Property Value
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
[Parameter]
public bool EnableSpeechToText { get; set; }
Property Value
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
[Parameter]
public string FilesField { get; set; }
Property Value
HeaderTemplate
Template for modifying the content of the header of the chat component.
Declaration
[Parameter]
public RenderFragment HeaderTemplate { get; set; }
Property Value
Height
Defines the height of the chat component.
IdField
Defines the field in the data source that contains the ID of the message.
InputValue
The value of the chat input field.
Declaration
[Parameter]
public string InputValue { get; set; }
Property Value
IsDeletedField
Defines the field in the data source that indicates whether the message is deleted.
Declaration
[Parameter]
public string IsDeletedField { get; set; }
Property Value
IsPinnedField
Defines the field in the data source that indicates whether the message is deleted.
Declaration
[Parameter]
public string IsPinnedField { get; set; }
Property Value
MessageBoxTemplate
A render fragment that allows customization of the whole message box section in the chat.
Declaration
[Parameter]
public RenderFragment MessageBoxTemplate { get; set; }
Property Value
MessageStatusTemplate
Template for modifying the appearance of the message status indicators in the chat.
Declaration
[Parameter]
public RenderFragment<ChatMessageStatusTemplateContext<TItem>> MessageStatusTemplate { get; set; }
Property Value
MessageTemplate
Template for modifying the appearance of the messages in the chat.
Declaration
[Parameter]
public RenderFragment<ChatMessageTemplateContext<TItem>> MessageTemplate { get; set; }
Property Value
MessageWidthMode
Defines the width mode of the messages in the chat. The available options are:
- Standard - Messages will have a width that fits their content.
- Full - Messages will take the full width of the chat container.
The default value is Standard.
Declaration
[Parameter]
public MessageWidthMode MessageWidthMode { get; set; }
Property Value
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
[Parameter]
public EventCallback<ChatDownloadEventArgs> OnDownload { get; set; }
Property Value
OnInputValueChanged
Event callback that is triggered when the input value changes.
Declaration
[Parameter]
public EventCallback<string> OnInputValueChanged { get; set; }
Property Value
OnMessageUnpin
Event callback that is triggered when a message is unpinned.
Declaration
[Parameter]
public EventCallback<ChatMessageUnpinEventArgs> OnMessageUnpin { get; set; }
Property Value
OnSendMessage
Event callback that is triggered when a message is sent. The arguments are of type ChatSendMessageEventArgs.
Declaration
[Parameter]
public EventCallback<ChatSendMessageEventArgs> OnSendMessage { get; set; }
Property Value
OnSuggestionClick
An event callback that is triggered when a suggestion is selected from the suggestions list. The arguments are of type ChatSuggestionClickEventArgs.
Declaration
[Parameter]
public EventCallback<ChatSuggestionClickEventArgs> OnSuggestionClick { get; set; }
Property Value
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
[Parameter]
public string ReplyToIdField { get; set; }
Property Value
StatusField
Defines the field in the data source that contains the status of the message.
Declaration
[Parameter]
public string StatusField { get; set; }
Property Value
SuggestedActionsField
Defines the field in the data source that contains the quick actions for the message.
Declaration
[Parameter]
public string SuggestedActionsField { get; set; }
Property Value
SuggestionTemplate
Template for modifying the appearance of the suggestions displayed in the chat input.
Declaration
[Parameter]
public RenderFragment<ChatSuggestionTemplateContext> SuggestionTemplate { get; set; }
Property Value
Suggestions
Use this parameter to provide a collection of suggestions that will be displayed as quick reply options in the chat input.
Declaration
[Parameter]
public IEnumerable<string> Suggestions { get; set; }
Property Value
TextField
The field in the data source that contains the text of the message.
Declaration
[Parameter]
public string TextField { get; set; }
Property Value
TimestampField
Defines the field in the data source that contains the timestamp of the message.
Declaration
[Parameter]
public string TimestampField { get; set; }
Property Value
TimestampTemplate
Defines a render fragment that contains the content of the chat time stamps displayed between messages.
Declaration
[Parameter]
public RenderFragment<ChatTimestampTemplateContext> TimestampTemplate { get; set; }
Property Value
Methods
AddSendMessageButtonSettings(ChatSendMessageButtonSettings)
Declaration
public void AddSendMessageButtonSettings(ChatSendMessageButtonSettings settings)
Parameters
settings
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
Overrides
Dispose()
Declaration
public override void Dispose()
Overrides
OnParametersSet()
Declaration
protected override void OnParametersSet()
Overrides
Refresh()
Refreshes the chat component, causing it to re-render.
Declaration
public void Refresh()
RemoveSendMessageButtonSettings()
Declaration
public void RemoveSendMessageButtonSettings()