New to Telerik UI for .NET MAUIStart a free 30-day trial

RadChat

Class

A component that visualizes chat conversation between two or more participants. Has a built-in mechanism for displaying time-pickers, action-cards, and other things that bot services commonly use. Has a built-in TypingIndicator to let the user know if othe participants in the chat are currently writing.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

C#
public class RadChat : RadContentView, IRadContentView, IContentView, IView, IElement, ITransform, IPadding, ICrossPlatformLayout

Inheritance: objectRadContentViewRadChat

Implements: IContentViewICrossPlatformLayoutIElementIPaddingIRadContentViewITransformIView...

Inherited Members RadContentView.ActualStyleClassPropertyRadContentView.OnChildAdded(Element)RadContentView.OnChildRemoved(Element, int)RadContentView.OnHandlerChanged()

Constructors

Initializes a new instance of the RadChat class.

C#
public RadChat()

Fields

Identifies the ActualRemoveAttachedFileCommand property.

C#
public static readonly BindableProperty ActualRemoveAttachedFileCommandProperty

Identifies the ActualScrollMediator property.

C#
public static readonly BindableProperty ActualScrollMediatorModeProperty

Identifies the ActualSendMessageCommand property.

C#
public static readonly BindableProperty ActualSendMessageCommandProperty

Identifies the AttachedFileConverter property.

C#
public static readonly BindableProperty AttachedFileConverterProperty

AttachedFilesProperty

BindableProperty

Identifies the AttachedFiles property.

C#
public static readonly BindableProperty AttachedFilesProperty

Identifies the AttachedFilesSource property.

C#
public static readonly BindableProperty AttachedFilesSourceProperty

Identifies the AttachFilesCommand property.

C#
public static readonly BindableProperty AttachFilesCommandProperty

AuthorProperty

BindableProperty

Identifies the Author property.

C#
public static readonly BindableProperty AuthorProperty

Identifies the AutoGenerateMoreButtonActions property.

C#
public static readonly BindableProperty AutoGenerateMoreButtonActionsProperty

AutoScrollModeProperty

BindableProperty

Identifies the AutoScrollMode property.

C#
public static readonly BindableProperty AutoScrollModeProperty

BackgroundColorProperty

BindableProperty

Identifies the BackgroundColor property.

C#
public static readonly BindableProperty BackgroundColorProperty

Identifies the ChatListViewItemStyle property.

C#
public static readonly BindableProperty ChatListViewItemStyleProperty

ControlTemplateProperty

BindableProperty

Identifies the ControlTemplate property.

C#
public static readonly BindableProperty ControlTemplateProperty

Identifies the DownloadAttachmentsCommand property.

C#
public static readonly BindableProperty DownloadAttachmentsCommandProperty

InputAreaStyleProperty

BindableProperty

Identifies the InputAreaStyle property.

C#
public static readonly BindableProperty InputAreaStyleProperty

Identifies the IsMoreButtonVisible property.

C#
public static readonly BindableProperty IsMoreButtonVisibleProperty

Identifies the IsSpeechToTextButtonVisible property.

C#
public static readonly BindableProperty IsSpeechToTextButtonVisibleProperty

ItemConverterProperty

BindableProperty

Identifies the ItemConverter property.

C#
public static readonly BindableProperty ItemConverterProperty

ItemsSourceProperty

BindableProperty

Identifies the ItemsSource property.

C#
public static readonly BindableProperty ItemsSourceProperty

Identifies the ItemTemplateSelector property.

C#
public static readonly BindableProperty ItemTemplateSelectorProperty

MessageProperty

BindableProperty

Identifies the Message property.

C#
public static readonly BindableProperty MessageProperty

Identifies the MoreButtonActionItemViewStyle property.

C#
public static readonly BindableProperty MoreButtonActionItemViewStyleProperty

Identifies the MoreButtonActions property.

C#
public static readonly BindableProperty MoreButtonActionsProperty

MoreButtonStyleProperty

BindableProperty

Identifies the MoreButtonStyle property.

C#
public static readonly BindableProperty MoreButtonStyleProperty

PickerProperty

BindableProperty

Identifies the Picker property.

C#
public static readonly BindableProperty PickerProperty

PickFileCommandProperty

BindableProperty

Identifies the PickFileCommand property.

C#
public static readonly BindableProperty PickFileCommandProperty

PickFileTypesProperty

BindableProperty

Identifies the PickFileTypes property.

C#
public static readonly BindableProperty PickFileTypesProperty

PickPhotoCommandProperty

BindableProperty

Identifies the PickPhotoCommand property.

C#
public static readonly BindableProperty PickPhotoCommandProperty

Identifies the RemoveAttachedFileCommand property.

C#
public static readonly BindableProperty RemoveAttachedFileCommandProperty

SendButtonStyleProperty

BindableProperty

Identifies the SendButtonStyle property.

C#
public static readonly BindableProperty SendButtonStyleProperty

Identifies the SendMessageButtonImage property.

C#
public static readonly BindableProperty SendMessageButtonImageProperty

Identifies the SendMessageCommand property.

C#
public static readonly BindableProperty SendMessageCommandProperty

Identifies the ShareAttachmentsCommand property.

C#
public static readonly BindableProperty ShareAttachmentsCommandProperty

Identifies the SpeechToTextButtonStyle property.

C#
public static readonly BindableProperty SpeechToTextButtonStyleProperty

TakePhotoCommandProperty

BindableProperty

Identifies the TakePhotoCommand property.

C#
public static readonly BindableProperty TakePhotoCommandProperty

TypingIndicatorProperty

BindableProperty

Identifies the TypingIndicator property.

C#
public static readonly BindableProperty TypingIndicatorProperty

Properties

Gets the actual command that is executed when removing an attached file. This command will execute the custom RemoveAttachedFileCommand.

C#
public ICommand ActualRemoveAttachedFileCommand { get; }

Gets or sets the actual ScrollMediator used by the chat to mediate the scrolling functionality.

C#
public ScrollMediator ActualScrollMediator { get; }

Gets the actual send command that is executed when sending a message. This command will execute the custom SendMessageCommand.

C#
public ICommand ActualSendMessageCommand { get; }

Gets or sets the converter that performs the conversion between a data item representing an attached file and a ChatAttachedFile.

C#
public IChatAttachedFileConverter AttachedFileConverter { get; set; }

Gets or sets a collection that contains the currently attached files that have not yet been sent.

C#
public ICollection<PromptInputAttachedFile> AttachedFiles { get; }

Gets or sets the items source from which the chat populates the AttachedFiles collection, i.e. the files that are to be uploaded and have not yet been sent.

C#
public IEnumerable AttachedFilesSource { get; set; }

Gets or sets the command that is executed when the files the end-user picked need to be attached/uploaded.

C#
public ICommand AttachFilesCommand { get; set; }

Gets or sets the current author of outgoing messages in the chat.

C#
public Author Author { get; set; }

Gets or sets a value indicating whether to automatically generate default actions for the 'More' button.

C#
public bool AutoGenerateMoreButtonActions { get; set; }

Gets or sets the mode which defines the automatic scrolling behavior of the RadChatListView when a message is sent or received.

C#
public AutoScrollMode AutoScrollMode { get; set; }
C#
public Color BackgroundColor { get; set; }

Gets or sets the Item Style of the RadChatListView in the RadChat control. The target type of this style is RadCollectionViewItemView.

C#
public Style ChatListViewItemStyle { get; set; }

ControlTemplate

ControlTemplate

Gets or sets the control template that defines the visual structure of RadChat.

C#
public ControlTemplate ControlTemplate { get; set; }
Property Value:

A ControlTemplate that defines the visual tree for the chat.

Gets or sets the command that is executed when the end user initiates download of attachments for a ChatAttachmentsMessage. The command parameter of this command is of type ChatDownloadAttachmentsCommandContext.

C#
public ICommand DownloadAttachmentsCommand { get; set; }

Gets or sets the style of the .

C#
public Style InputAreaStyle { get; set; }

Gets or sets a value indicating whether the 'More' button is visible in the chat input area. When set to true, the 'More' button is displayed, allowing users to access additional actions such as attaching files or images. When set to false, the 'More' button is hidden and these actions are not accessible from the input area. The default value is false.

C#
public bool IsMoreButtonVisible { get; set; }

Gets or sets a value indicating whether the Speech-To-Text button is visible in the chat input area. When set to true, the Speech-To-Text button is displayed, allowing users to dictate messages using speech recognition. When set to false, the button is hidden and speech-to-text functionality is not accessible from the input area. The default value is platform-dependent: false on Windows, true on other platforms.

C#
public bool IsSpeechToTextButtonVisible { get; set; }

Gets or sets the converter that performs the conversion between data and chat items.

C#
public IChatItemConverter ItemConverter { get; set; }

Gets the collection of chat items.

C#
public IList<ChatItem> Items { get; }

Gets or sets the items source from which chat items are generated.

C#
public IEnumerable ItemsSource { get; set; }

ItemTemplateSelector

DataTemplateSelector

Gets or sets the template selector for visualizing chat items.

C#
public DataTemplateSelector ItemTemplateSelector { get; set; }

Gets or sets the message that is typed in the chat entry.

C#
public object Message { get; set; }

Gets or sets a custom style for the action item views in the 'More' button dropdown. The actual style that is applied is a merger between this style and the default style for RadTemplatedButton. The target type of this style is RadTemplatedButton.

C#
public Style MoreButtonActionItemViewStyle { get; set; }

Gets or sets the collection of toolbar actions displayed in the input area more button.

C#
public IList<PromptInputButtonAction> MoreButtonActions { get; set; }

Gets or sets a custom style that is to be applied to the 'More' button. The actual style that is applied is a merger between this style and the default style for the RadDropDownButton. The target type of this style is RadDropDownButton .

C#
public Style MoreButtonStyle { get; set; }

Picker

View

Gets or sets the inline picker of the chat.

C#
public View Picker { get; set; }

Gets or sets the command that opens the for attaching files for upload.

C#
public ICommand PickFileCommand { get; set; }

PickFileTypes

FilePickerFileType

Gets or sets the type of files that can be attached in the UI that is shown when the end-user clicks the pick-file button (attach-files button).

C#
public FilePickerFileType PickFileTypes { get; set; }

Gets or sets the command that opens the for attaching photos for upload.

C#
public ICommand PickPhotoCommand { get; set; }

Gets or sets the command that should remove an attached file from the AttachedFilesSource collection in the view model.

C#
public ICommand RemoveAttachedFileCommand { get; set; }

Gets or sets the style of the send button in the RadChat control. The actual style that is applied is a merger between this style and the default style for the send button. The target type of this style is RadTemplatedButton.

C#
public Style SendButtonStyle { get; set; }

Gets or sets the image for the send message button.

C#
public ImageSource SendMessageButtonImage { get; set; }

Gets or sets the custom command that will be executed when sending a message (when the Send message button is pressed or Enter is pressed). The parameter of this command is of type object and the value is the same as the Message property.

C#
public ICommand SendMessageCommand { get; set; }

Gets or sets the command that triggers the share attachments operation.

C#
public ICommand ShareAttachmentsCommand { get; set; }

Gets or sets the style of the RadSpeechToTextButton in the RadChat control. The actual style that is applied is a merger between this style and the default style for the RadSpeechToTextButton The target type of this style is RadSpeechToTextButton.

C#
public Style SpeechToTextButtonStyle { get; set; }

Gets or sets the command that opens the camera for attaching a photo.

C#
public ICommand TakePhotoCommand { get; set; }

Gets or sets the typing indicator displayed when another author is typing.

C#
public View TypingIndicator { get; set; }

Methods

Attempts to set focus to the entry element.

C#
public bool FocusEntry()
Returns:

bool

true if the keyboard focus was set to the entry element; false if the call to this method did not force a focus change.

C#
protected override void OnApplyTemplate()

Called when the binding context changes.

C#
protected override void OnBindingContextChanged()

Overrides: RadContentView.OnBindingContextChanged()

C#
protected override void OnPropertyChanged(string propertyName = null)
Parameters:propertyNamestring

Scrolls to the item at the provided index.

C#
public void ScrollTo(int index)
Parameters:indexint

The index of the item to scroll to.

Stops the speech to text recognition.

If the speech recognizer is currently in the StartingListening or Listening state, this method will stop the recognition process. If the recognizer is not listening, this method has no effect.

C#
public Task StopSpeechToTextRecognition()
Returns:

Task

Events

Raised when the end user picks files to attach.

C#
public event EventHandler<ChatAttachFilesEventArgs> AttachFiles

Raised when the end user removes an attached file, via the X button of the PromptInputAttachedFilesView.

C#
public event EventHandler<ChatRemoveAttachedFileEventArgs> RemoveAttachedFile

Raised when a message is sent from the chat by the current author (by clicking the send messsage button or pressing Enter).

C#
public event EventHandler SendMessage
In this article
DefinitionConstructorsRadChat()FieldsActualRemoveAttachedFileCommandPropertyActualScrollMediatorModePropertyActualSendMessageCommandPropertyAttachFilesCommandPropertyAttachedFileConverterPropertyAttachedFilesPropertyAttachedFilesSourcePropertyAuthorPropertyAutoGenerateMoreButtonActionsPropertyAutoScrollModePropertyBackgroundColorPropertyChatListViewItemStylePropertyControlTemplatePropertyDownloadAttachmentsCommandPropertyInputAreaStylePropertyIsMoreButtonVisiblePropertyIsSpeechToTextButtonVisiblePropertyItemConverterPropertyItemTemplateSelectorPropertyItemsSourcePropertyMessagePropertyMoreButtonActionItemViewStylePropertyMoreButtonActionsPropertyMoreButtonStylePropertyPickFileCommandPropertyPickFileTypesPropertyPickPhotoCommandPropertyPickerPropertyRemoveAttachedFileCommandPropertySendButtonStylePropertySendMessageButtonImagePropertySendMessageCommandPropertyShareAttachmentsCommandPropertySpeechToTextButtonStylePropertyTakePhotoCommandPropertyTypingIndicatorPropertyPropertiesActualRemoveAttachedFileCommandActualScrollMediatorActualSendMessageCommandAttachFilesCommandAttachedFileConverterAttachedFilesAttachedFilesSourceAuthorAutoGenerateMoreButtonActionsAutoScrollModeBackgroundColorChatListViewItemStyleControlTemplateDownloadAttachmentsCommandInputAreaStyleIsMoreButtonVisibleIsSpeechToTextButtonVisibleItemConverterItemTemplateSelectorItemsItemsSourceMessageMoreButtonActionItemViewStyleMoreButtonActionsMoreButtonStylePickFileCommandPickFileTypesPickPhotoCommandPickerRemoveAttachedFileCommandSendButtonStyleSendMessageButtonImageSendMessageCommandShareAttachmentsCommandSpeechToTextButtonStyleTakePhotoCommandTypingIndicatorMethodsFocusEntry()OnApplyTemplate()OnBindingContextChanged()OnPropertyChanged(string)ScrollTo(int)StopSpeechToTextRecognition()EventsAttachFilesRemoveAttachedFileSendMessage
Not finding the help you need?
Contact Support