New to Telerik UI for WPFStart a free 30-day trial

RadChat

Class

RadChat is control that provides the look and feel of a chat application. It exposes API for managing and display of text and media messages.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.ConversationalUI.dll

Syntax:

C#
[TelerikToolboxCategory("ConversationalUI")]
public class RadChat : Control, IMessageReportSubscriber

Inheritance: objectRadChat

Derived Classes: PdfChat

Implements: IMessageReportSubscriber

Constructors

Initializes a new instance of the RadChat class.

C#
public RadChat()

Fields

Identifies the AdditionalContentTemplateProperty dependency property.

C#
public static readonly DependencyProperty AdditionalContentTemplateProperty

Identifies the event.

C#
public static readonly RoutedEvent AttachmentActionRequestedEvent

Identifies the AutoIncludeTimeBreaks dependency property.

C#
public static readonly DependencyProperty AutoIncludeTimeBreaksProperty

Identifies the CanUserSelectMessage dependency property.

C#
public static readonly DependencyProperty CanUserSelectMessageProperty

CurrentAuthorProperty

DependencyProperty

Identifies the CurrentAuthor dependency property.

C#
public static readonly DependencyProperty CurrentAuthorProperty

DataSourceProperty

DependencyProperty

Identifies the DataSource dependency property.

C#
public static readonly DependencyProperty DataSourceProperty

InputBoxTextProperty

DependencyProperty

Identifies the InputBoxText dependency property.

C#
public static readonly DependencyProperty InputBoxTextProperty

Identifies the InputBoxWatermarkContent dependency property.

C#
public static readonly DependencyProperty InputBoxWatermarkContentProperty

IsMoreButtonVisibleProperty

DependencyProperty

Identifies the IsMoreButtonVisible dependency property.

C#
public static readonly DependencyProperty IsMoreButtonVisibleProperty

Identifies the IsSpeechToTextButtonVisible dependency property.

C#
public static readonly DependencyProperty IsSpeechToTextButtonVisibleProperty

Identifies the MaxVisibleAttachments dependency property.

C#
public static readonly DependencyProperty MaxVisibleAttachmentsProperty

MessageConverterProperty

DependencyProperty

Identifies the MessageConverter dependency property.

C#
public static readonly DependencyProperty MessageConverterProperty

Identifies the MessageListTemplateSelector dependency property.

C#
public static readonly DependencyProperty MessageListTemplateSelectorProperty

Identifies the MessageOverlayTemplateSelector dependency property.

C#
public static readonly DependencyProperty MessageOverlayTemplateSelectorProperty

Identifies the MessagePopupTemplateSelector dependency property.

C#
public static readonly DependencyProperty MessagePopupTemplateSelectorProperty

Identifies the RegenerateResponse routed event.

C#
public static readonly RoutedEvent RegenerateResponseEvent
Remarks:

This event uses the bubbling routing strategy, allowing it to propagate from child to parent elements in the visual tree. It is typically used to signal that a response regeneration action has been requested.

Identifies the Event.

C#
public static readonly RoutedEvent ReportMessageResultEvent

SendButtonContentProperty

DependencyProperty

Identifies the SendButtonContent dependency property.

C#
public static readonly DependencyProperty SendButtonContentProperty

Identifies the SendButtonContentTemplate dependency property.

C#
public static readonly DependencyProperty SendButtonContentTemplateProperty

SendCommandProperty

DependencyProperty

Identifies the SendCommand dependency property.

C#
public static readonly DependencyProperty SendCommandProperty

SendMessageEvent

RoutedEvent

Identifies the Event.

C#
public static readonly RoutedEvent SendMessageEvent

Identifies the ShowOtherAuthorMessageBackground dependency property.

C#
public static readonly DependencyProperty ShowOtherAuthorMessageBackgroundProperty

Identifies the Event.

C#
public static readonly RoutedEvent SuggestedActionReportedEvent

Identifies the SuggestedActionsOrientation dependency property.

C#
public static readonly DependencyProperty SuggestedActionsOrientationProperty

SuggestedActionsProperty

DependencyProperty

Identifies the SuggestedActions dependency property.

C#
public static readonly DependencyProperty SuggestedActionsProperty

Identifies the SuggestedActionsVisibility dependency property.

C#
public static readonly DependencyProperty SuggestedActionsVisibilityProperty

TimeBreakFormatProperty

DependencyProperty

Identifies the TimeBreakFormat dependency property.

C#
public static readonly DependencyProperty TimeBreakFormatProperty

TimeBreakIntervalProperty

DependencyProperty

Identifies the TimeBreakInterval dependency property.

C#
public static readonly DependencyProperty TimeBreakIntervalProperty

TypingCommandProperty

DependencyProperty

Identifies the TypingCommand dependency property.

C#
public static readonly DependencyProperty TypingCommandProperty

TypingIndicatorIconProperty

DependencyProperty

Identifies the TypingIndicatorIcon dependency property.

C#
public static readonly DependencyProperty TypingIndicatorIconProperty

TypingIndicatorTextProperty

DependencyProperty

Identifies the TypingIndicatorText dependency property.

C#
public static readonly DependencyProperty TypingIndicatorTextProperty

Identifies the TypingIndicatorVisibility dependency property.

C#
public static readonly DependencyProperty TypingIndicatorVisibilityProperty

UserVotedEvent

RoutedEvent

Identifies the event.

C#
public static readonly RoutedEvent UserVotedEvent

Identifies the VerticalAvatarAlignment dependency property.

C#
public static readonly DependencyProperty VerticalAvatarAlignmentProperty

Properties

Gets or sets the custom data template used to display suggestions in the suggestion list.

C#
public DataTemplate AdditionalContentTemplate { get; set; }

Gets or sets value indicating whether TimeBreaks are automatically included.

C#
public bool AutoIncludeTimeBreaks { get; set; }

Gets or sets value indicating whether users can select inline messages through the UI.

C#
public bool CanUserSelectMessage { get; set; }

Gets or sets the current author.

C#
public Author CurrentAuthor { get; set; }

Gets or sets a data source that will be used to generate messages in data-bound scenarios.

C#
public IEnumerable DataSource { get; set; }

Gets the collection of inline messages.

C#
protected virtual IEnumerable<MessageBase> InlineMessages { get; }

Gets or sets the input box text.

C#
public string InputBoxText { get; set; }

Gets or sets the input box watermark content.

C#
public object InputBoxWatermarkContent { get; set; }

Gets or sets a value indicating whether the more button is visible in the prompt input.

C#
public bool IsMoreButtonVisible { get; set; }

Gets or sets a value indicating whether the speech-to-text button is visible in the prompt input.

C#
public bool IsSpeechToTextButtonVisible { get; set; }

Gets the last message.

C#
public virtual InlineViewModel LastMessage { get; }

Gets the last message group.

C#
public virtual MessageGroupViewModel LastMessageGroup { get; }

Gets or sets the maximum number of attachments visible before the rest are collapsed behind an expand button.

C#
public int MaxVisibleAttachments { get; set; }

Gets or sets an IMessageConverter that will be used for converting messages to DataSource type vice versa.

C#
public IMessageConverter MessageConverter { get; set; }

Gets the collection of MessageGroups.

C#
public ObservableCollection<MessageGroupViewModel> MessageGroups { get; }

Gets the collection of MessageListItems (MessageGroups and TimeBreaks).

C#
public ObservableCollection<MessageListItemViewModelBase> MessageListItems { get; }

Gets or sets the DataTemplate selector that is used for displaying messages in ChatMessageList.

C#
public MessageTemplateSelector MessageListTemplateSelector { get; set; }

Gets or sets the DataTemplate selector that is used for displaying messages in ChatOverlay.

C#
public MessageTemplateSelector MessageOverlayTemplateSelector { get; set; }

Gets or sets the DataTemplate selector that is used for displaying messages in ChatPopupPlaceholder.

C#
public MessageTemplateSelector MessagePopupTemplateSelector { get; set; }

Gets the MessageReporter control that processes result actions.

C#
public MessageReporter MessageReporter { get; }

Implements: IMessageReportSubscriber.MessageReporter

Gets or sets the content to display inside the send button of the prompt input. When set, this replaces the default send/stop glyph icons.

C#
public object SendButtonContent { get; set; }

Gets or sets the data template used to display the SendButtonContent.

C#
public DataTemplate SendButtonContentTemplate { get; set; }

Gets or sets the command that is executed when a new message is typed in the UI and then sent.

C#
public ICommand SendCommand { get; set; }

Gets or sets a value indicating whether the background of messages from other authors is visible.

C#
public bool ShowOtherAuthorMessageBackground { get; set; }

Gets or sets the list of suggested actions.

C#
public ObservableCollection<SuggestedAction> SuggestedActions { get; set; }

Gets or sets the orientation of suggested action panel.

C#
public Orientation SuggestedActionsOrientation { get; set; }

Gets or sets a value that indicates whether suggested action panel is visible or not.

C#
public Visibility SuggestedActionsVisibility { get; set; }

Gets or sets the DateTime string format that is used to display time breaks.

C#
public string TimeBreakFormat { get; set; }

Gets or sets the interval that should be use to automatically place time breaks.

C#
public TimeSpan? TimeBreakInterval { get; set; }

Gets or sets the command that should be executed on typing.

C#
public ICommand TypingCommand { get; set; }

Gets or sets the icon of the typing indicator.

C#
public ImageSource TypingIndicatorIcon { get; set; }

Gets or sets the text of the typing indicator.

C#
public string TypingIndicatorText { get; set; }

Gets or sets a value that indicates whether the typing indicator is visible or not.

C#
public Visibility TypingIndicatorVisibility { get; set; }

VerticalAvatarAlignment

VerticalAlignment

Gets or sets the vertical alignment for Author's Avatar.

C#
public VerticalAlignment VerticalAvatarAlignment { get; set; }

Methods

Adds a new Message to RadChat.

C#
public virtual void AddMessage(Author author, string messageText)
Parameters:authorAuthormessageTextstring

Adds a new Message to RadChat.

C#
public virtual void AddMessage(MessageBase message)
Parameters:messageMessageBase

Adds a time break with the given header.

C#
public virtual void AddTimeBreak(string header)
Parameters:headerstring

Closes the overlay view and its content.

C#
public void CloseOverlay()

Closes the popup placeholder view and its content.

C#
public void ClosePopup()

Uses the given MessageConverter to convert data item to message.

C#
protected virtual MessageBase ConvertItemToMessage(object item)
Parameters:itemobjectReturns:

MessageBase

Uses the given MessageConverter to convert message to data object.

C#
protected virtual object ConvertMessageToDataItem(MessageBase message)
Parameters:messageMessageBaseReturns:

object

Creates a new message group for the given author.

C#
protected virtual MessageGroupViewModel CreateMessageGroup(Author author)
Parameters:authorAuthorReturns:

MessageGroupViewModel

Returns the inline message by its index position.

C#
public virtual MessageBase GetMessageByIndex(int index)
Parameters:indexintReturns:

MessageBase

Raises the AddingTimeBreak event.

C#
protected virtual void OnAddingTimeBreak(TimeBreakEventArgs timeBreakArgs)
Parameters:timeBreakArgsTimeBreakEventArgs
C#
public override void OnApplyTemplate()

Raises the AttachmentActionRequested event.

C#
protected virtual void OnAttachmentActionRequested(AttachmentActionEventArgs args)
Parameters:argsAttachmentActionEventArgs

The event arguments.

Returns an automation peer for this RadChat.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

Raises the RegenerateResponse event.

C#
protected virtual void OnRegenerateResponse(RegenerateResponseEventArgs args)
Parameters:argsRegenerateResponseEventArgs

The event arguments.

Raises the ReportMessageResult event.

C#
protected virtual void OnReportMessageResult(MessageResultEventArgs args)
Parameters:argsMessageResultEventArgs

Raises the SendMessage routed event.

C#
protected virtual void OnSendMessage(SendMessageEventArgs args)
Parameters:argsSendMessageEventArgs

Raises the SuggestedActionReported event.

C#
protected virtual void OnSuggestedActionReported(SuggestedActionsEventArgs suggestedActionsArgs)
Parameters:suggestedActionsArgsSuggestedActionsEventArgs

Raises the UserVoted event.

C#
protected virtual void OnUserVoted(UserVotedEventArgs args)
Parameters:argsUserVotedEventArgs

The event arguments.

Rebinds the RadChat, using the collection set as DataSource.

C#
protected virtual void RebindDataSource()

Removes an existing inline message from RadChat.

C#
public virtual void RemoveMessage(MessageBase message)
Parameters:messageMessageBase

Implements: IMessageReportSubscriber.RemoveMessage(MessageBase)

Adds a message as overlay content.

C#
protected void ShowMessageInOverlay(MessageBase message)
Parameters:messageMessageBase

Adds a message as popup content.

C#
protected void ShowMessageInPopup(MessageBase message)
Parameters:messageMessageBase

Events

Event is raised when time break is added.

C#
public event EventHandler<TimeBreakEventArgs> AddingTimeBreak

Occurs when an attachment action (download, share) is requested.

C#
public event EventHandler<AttachmentActionEventArgs> AttachmentActionRequested

Occurs when a response needs to be regenerated.

C#
public event EventHandler<RegenerateResponseEventArgs> RegenerateResponse
Remarks:

This event is triggered to signal that a response should be regenerated. Subscribers can handle this event to perform custom logic when a regeneration is required.

Event is raised when response action reports result.

C#
public event EventHandler<MessageResultEventArgs> ReportMessageResult

Event is raised when a new message is typed and sent by the current author.

C#
public event EventHandler<SendMessageEventArgs> SendMessage

Event is raised when suggested action reports result.

C#
public event EventHandler<SuggestedActionsEventArgs> SuggestedActionReported

Occurs when a user votes (e.g., upvote or downvote) on a message.

C#
public event EventHandler<UserVotedEventArgs> UserVoted
In this article
DefinitionConstructorsRadChat()FieldsAdditionalContentTemplatePropertyAttachmentActionRequestedEventAutoIncludeTimeBreaksPropertyCanUserSelectMessagePropertyCurrentAuthorPropertyDataSourcePropertyInputBoxTextPropertyInputBoxWatermarkContentPropertyIsMoreButtonVisiblePropertyIsSpeechToTextButtonVisiblePropertyMaxVisibleAttachmentsPropertyMessageConverterPropertyMessageListTemplateSelectorPropertyMessageOverlayTemplateSelectorPropertyMessagePopupTemplateSelectorPropertyRegenerateResponseEventReportMessageResultEventSendButtonContentPropertySendButtonContentTemplatePropertySendCommandPropertySendMessageEventShowOtherAuthorMessageBackgroundPropertySuggestedActionReportedEventSuggestedActionsOrientationPropertySuggestedActionsPropertySuggestedActionsVisibilityPropertyTimeBreakFormatPropertyTimeBreakIntervalPropertyTypingCommandPropertyTypingIndicatorIconPropertyTypingIndicatorTextPropertyTypingIndicatorVisibilityPropertyUserVotedEventVerticalAvatarAlignmentPropertyPropertiesAdditionalContentTemplateAutoIncludeTimeBreaksCanUserSelectMessageCurrentAuthorDataSourceInlineMessagesInputBoxTextInputBoxWatermarkContentIsMoreButtonVisibleIsSpeechToTextButtonVisibleLastMessageLastMessageGroupMaxVisibleAttachmentsMessageConverterMessageGroupsMessageListItemsMessageListTemplateSelectorMessageOverlayTemplateSelectorMessagePopupTemplateSelectorMessageReporterSendButtonContentSendButtonContentTemplateSendCommandShowOtherAuthorMessageBackgroundSuggestedActionsSuggestedActionsOrientationSuggestedActionsVisibilityTimeBreakFormatTimeBreakIntervalTypingCommandTypingIndicatorIconTypingIndicatorTextTypingIndicatorVisibilityVerticalAvatarAlignmentMethodsAddMessage(Author, string)AddMessage(MessageBase)AddTimeBreak(string)CloseOverlay()ClosePopup()ConvertItemToMessage(object)ConvertMessageToDataItem(MessageBase)CreateMessageGroup(Author)GetMessageByIndex(int)OnAddingTimeBreak(TimeBreakEventArgs)OnApplyTemplate()OnAttachmentActionRequested(AttachmentActionEventArgs)OnCreateAutomationPeer()OnInitialized(EventArgs)OnRegenerateResponse(RegenerateResponseEventArgs)OnReportMessageResult(MessageResultEventArgs)OnSendMessage(SendMessageEventArgs)OnSuggestedActionReported(SuggestedActionsEventArgs)OnUserVoted(UserVotedEventArgs)RebindDataSource()RemoveMessage(MessageBase)ShowMessageInOverlay(MessageBase)ShowMessageInPopup(MessageBase)EventsAddingTimeBreakAttachmentActionRequestedRegenerateResponseReportMessageResultSendMessageSuggestedActionReportedUserVoted
Not finding the help you need?
Contact Support