ClassRadChat
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:
[TelerikToolboxCategory("ConversationalUI")]
public class RadChat : Control, IMessageReportSubscriber
Inheritance: objectRadChat
Derived Classes:
Implements:
Constructors
Fields
AdditionalContentTemplateProperty
Identifies the AdditionalContentTemplateProperty dependency property.
Declaration
public static readonly DependencyProperty AdditionalContentTemplateProperty
Field Value
DependencyProperty
AutoIncludeTimeBreaksProperty
Identifies the AutoIncludeTimeBreaks dependency property.
Declaration
public static readonly DependencyProperty AutoIncludeTimeBreaksProperty
Field Value
DependencyProperty
CanUserSelectMessageProperty
Identifies the CanUserSelectMessage dependency property.
Declaration
public static readonly DependencyProperty CanUserSelectMessageProperty
Field Value
DependencyProperty
CurrentAuthorProperty
Identifies the CurrentAuthor dependency property.
Declaration
public static readonly DependencyProperty CurrentAuthorProperty
Field Value
DependencyProperty
DataSourceProperty
Identifies the DataSource dependency property.
Declaration
public static readonly DependencyProperty DataSourceProperty
Field Value
DependencyProperty
InputBoxTextProperty
Identifies the InputBoxText dependency property.
Declaration
public static readonly DependencyProperty InputBoxTextProperty
Field Value
DependencyProperty
InputBoxWatermarkContentProperty
Identifies the InputBoxWatermarkContent dependency property.
Declaration
public static readonly DependencyProperty InputBoxWatermarkContentProperty
Field Value
DependencyProperty
IsToolBarOpenProperty
Identifies the IsToolBarOpen dependency property.
Declaration
public static readonly DependencyProperty IsToolBarOpenProperty
Field Value
DependencyProperty
MessageConverterProperty
Identifies the MessageConverter dependency property.
Declaration
public static readonly DependencyProperty MessageConverterProperty
Field Value
DependencyProperty
MessageListTemplateSelectorProperty
Identifies the MessageListTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty MessageListTemplateSelectorProperty
Field Value
DependencyProperty
MessageOverlayTemplateSelectorProperty
Identifies the MessageOverlayTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty MessageOverlayTemplateSelectorProperty
Field Value
DependencyProperty
MessagePopupTemplateSelectorProperty
Identifies the MessagePopupTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty MessagePopupTemplateSelectorProperty
Field Value
DependencyProperty
RegenerateResponseEvent
Identifies the RegenerateResponse routed event.
Declaration
public static readonly RoutedEvent RegenerateResponseEvent
Field Value
RoutedEvent
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.
ReportMessageResultEvent
Identifies the Event.
Declaration
public static readonly RoutedEvent ReportMessageResultEvent
Field Value
RoutedEvent
SendCommandProperty
Identifies the SendCommand dependency property.
Declaration
public static readonly DependencyProperty SendCommandProperty
Field Value
DependencyProperty
SendMessageEvent
Identifies the Event.
Declaration
public static readonly RoutedEvent SendMessageEvent
Field Value
RoutedEvent
SuggestedActionReportedEvent
Identifies the Event.
Declaration
public static readonly RoutedEvent SuggestedActionReportedEvent
Field Value
RoutedEvent
SuggestedActionsOrientationProperty
Identifies the SuggestedActionsOrientation dependency property.
Declaration
public static readonly DependencyProperty SuggestedActionsOrientationProperty
Field Value
DependencyProperty
SuggestedActionsProperty
Identifies the SuggestedActions dependency property.
Declaration
public static readonly DependencyProperty SuggestedActionsProperty
Field Value
DependencyProperty
SuggestedActionsVisibilityProperty
Identifies the SuggestedActionsVisibility dependency property.
Declaration
public static readonly DependencyProperty SuggestedActionsVisibilityProperty
Field Value
DependencyProperty
TimeBreakFormatProperty
Identifies the TimeBreakFormat dependency property.
Declaration
public static readonly DependencyProperty TimeBreakFormatProperty
Field Value
DependencyProperty
TimeBreakIntervalProperty
Identifies the TimeBreakInterval dependency property.
Declaration
public static readonly DependencyProperty TimeBreakIntervalProperty
Field Value
DependencyProperty
ToolBarCommandTemplateProperty
Identifies the ToolBarCommandTemplate dependency property.
Declaration
public static readonly DependencyProperty ToolBarCommandTemplateProperty
Field Value
DependencyProperty
ToolBarCommandTemplateSelectorProperty
Identifies the ToolBarCommandTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty ToolBarCommandTemplateSelectorProperty
Field Value
DependencyProperty
ToolBarCommandsProperty
Identifies the ToolBarCommands dependency property.
Declaration
public static readonly DependencyProperty ToolBarCommandsProperty
Field Value
DependencyProperty
TypingCommandProperty
Identifies the TypingCommand dependency property.
Declaration
public static readonly DependencyProperty TypingCommandProperty
Field Value
DependencyProperty
TypingIndicatorIconProperty
Identifies the TypingIndicatorIcon dependency property.
Declaration
public static readonly DependencyProperty TypingIndicatorIconProperty
Field Value
DependencyProperty
TypingIndicatorTextProperty
Identifies the TypingIndicatorText dependency property.
Declaration
public static readonly DependencyProperty TypingIndicatorTextProperty
Field Value
DependencyProperty
TypingIndicatorVisibilityProperty
Identifies the TypingIndicatorVisibility dependency property.
Declaration
public static readonly DependencyProperty TypingIndicatorVisibilityProperty
Field Value
DependencyProperty
UserVotedEvent
Identifies the event.
Declaration
public static readonly RoutedEvent UserVotedEvent
Field Value
RoutedEvent
VerticalAvatarAlignmentProperty
Identifies the VerticalAvatarAlignment dependency property.
Declaration
public static readonly DependencyProperty VerticalAvatarAlignmentProperty
Field Value
DependencyProperty
Properties
AdditionalContentTemplate
Gets or sets the custom data template used to display suggestions in the suggestion list.
Declaration
public DataTemplate AdditionalContentTemplate { get; set; }
Property Value
DataTemplate
AutoIncludeTimeBreaks
Gets or sets value indicating whether TimeBreaks are automatically included.
CanUserSelectMessage
Gets or sets value indicating whether users can select inline messages through the UI.
CurrentAuthor
Gets or sets the current author.
DataSource
Gets or sets a data source that will be used to generate messages in data-bound scenarios.
Declaration
public IEnumerable DataSource { get; set; }
Property Value
InlineMessages
Gets the collection of inline messages.
Declaration
protected virtual IEnumerable<MessageBase> InlineMessages { get; }
Property Value
InputBoxText
Gets or sets the input box text.
InputBoxWatermarkContent
Gets or sets the input box watermark content.
Declaration
public object InputBoxWatermarkContent { get; set; }
Property Value
IsToolBarOpen
Gets or sets a value indicating whether the tool bar is open or not.
LastMessage
Gets the last message.
Declaration
public virtual InlineViewModel LastMessage { get; }
Property Value
LastMessageGroup
Gets the last message group.
Declaration
public virtual MessageGroupViewModel LastMessageGroup { get; }
Property Value
MessageConverter
Gets or sets an IMessageConverter that will be used for converting messages to DataSource type vice versa.
Declaration
public IMessageConverter MessageConverter { get; set; }
Property Value
MessageGroups
Gets the collection of MessageGroups.
Declaration
public ObservableCollection<MessageGroupViewModel> MessageGroups { get; }
Property Value
MessageListItems
Gets the collection of MessageListItems (MessageGroups and TimeBreaks).
Declaration
public ObservableCollection<MessageListItemViewModelBase> MessageListItems { get; }
Property Value
MessageListTemplateSelector
Gets or sets the DataTemplate selector that is used for displaying messages in ChatMessageList.
Declaration
public MessageTemplateSelector MessageListTemplateSelector { get; set; }
Property Value
MessageOverlayTemplateSelector
Gets or sets the DataTemplate selector that is used for displaying messages in ChatOverlay.
Declaration
public MessageTemplateSelector MessageOverlayTemplateSelector { get; set; }
Property Value
MessagePopupTemplateSelector
Gets or sets the DataTemplate selector that is used for displaying messages in ChatPopupPlaceholder.
Declaration
public MessageTemplateSelector MessagePopupTemplateSelector { get; set; }
Property Value
MessageReporter
Gets the MessageReporter control that processes result actions.
Declaration
public MessageReporter MessageReporter { get; }
Property Value
Implements
SendCommand
Gets or sets the command that is executed when a new message is typed in the UI and then sent.
SuggestedActions
Gets or sets the list of suggested actions.
Declaration
public ObservableCollection<SuggestedAction> SuggestedActions { get; set; }
Property Value
SuggestedActionsOrientation
Gets or sets the orientation of suggested action panel.
Declaration
public Orientation SuggestedActionsOrientation { get; set; }
Property Value
Orientation
SuggestedActionsVisibility
Gets or sets a value that indicates whether suggested action panel is visible or not.
Declaration
public Visibility SuggestedActionsVisibility { get; set; }
Property Value
Visibility
TimeBreakFormat
Gets or sets the DateTime string format that is used to display time breaks.
TimeBreakInterval
Gets or sets the interval that should be use to automatically place time breaks.
Declaration
public TimeSpan? TimeBreakInterval { get; set; }
Property Value
ToolBarCommandTemplate
Gets or sets a data template for the ToolBar command buttons' content.
Declaration
public DataTemplate ToolBarCommandTemplate { get; set; }
Property Value
DataTemplate
ToolBarCommandTemplateSelector
Gets or sets a template selector that is used for selecting ToolBar command buttons' content.
Declaration
public DataTemplateSelector ToolBarCommandTemplateSelector { get; set; }
Property Value
DataTemplateSelector
ToolBarCommands
Gets the list of ToolBar commands.
Declaration
public ObservableCollection<ToolBarCommand> ToolBarCommands { get; }
Property Value
TypingCommand
Gets or sets the command that should be executed on typing.
TypingIndicatorIcon
Gets or sets the icon of the typing indicator.
Declaration
public ImageSource TypingIndicatorIcon { get; set; }
Property Value
ImageSource
TypingIndicatorText
Gets or sets the text of the typing indicator.
TypingIndicatorVisibility
Gets or sets a value that indicates whether the typing indicator is visible or not.
Declaration
public Visibility TypingIndicatorVisibility { get; set; }
Property Value
Visibility
VerticalAvatarAlignment
Gets or sets the vertical alignment for Author's Avatar.
Declaration
public VerticalAlignment VerticalAvatarAlignment { get; set; }
Property Value
VerticalAlignment
Methods
AddMessage(Author, string)
Adds a new Message to RadChat.
AddMessage(MessageBase)
Adds a new Message to RadChat.
Declaration
public virtual void AddMessage(MessageBase message)
Parameters
message
AddTimeBreak(string)
Adds a time break with the given header.
Declaration
public virtual void AddTimeBreak(string header)
Parameters
header
CloseOverlay()
Closes the overlay view and its content.
Declaration
public void CloseOverlay()
ClosePopup()
Closes the popup placeholder view and its content.
Declaration
public void ClosePopup()
ConvertItemToMessage(object)
Uses the given MessageConverter to convert data item to message.
Declaration
protected virtual MessageBase ConvertItemToMessage(object item)
Parameters
item
Returns
ConvertMessageToDataItem(MessageBase)
Uses the given MessageConverter to convert message to data object.
Declaration
protected virtual object ConvertMessageToDataItem(MessageBase message)
Parameters
message
Returns
CreateMessageGroup(Author)
Creates a new message group for the given author.
Declaration
protected virtual MessageGroupViewModel CreateMessageGroup(Author author)
Parameters
author
Returns
GetMessageByIndex(int)
Returns the inline message by its index position.
Declaration
public virtual MessageBase GetMessageByIndex(int index)
Parameters
index
Returns
OnAddingTimeBreak(TimeBreakEventArgs)
Raises the AddingTimeBreak event.
Declaration
protected virtual void OnAddingTimeBreak(TimeBreakEventArgs timeBreakArgs)
Parameters
timeBreakArgs
OnApplyTemplate()
Declaration
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Returns an automation peer for this RadChat.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
AutomationPeer
OnInitialized(EventArgs)
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
OnRegenerateResponse(RegenerateResponseEventArgs)
Raises the RegenerateResponse event.
Declaration
protected virtual void OnRegenerateResponse(RegenerateResponseEventArgs args)
Parameters
args
The event arguments.
OnReportMessageResult(MessageResultEventArgs)
Raises the ReportMessageResult event.
Declaration
protected virtual void OnReportMessageResult(MessageResultEventArgs args)
Parameters
args
OnSendMessage(SendMessageEventArgs)
Raises the SendMessage routed event.
Declaration
protected virtual void OnSendMessage(SendMessageEventArgs args)
Parameters
args
OnSuggestedActionReported(SuggestedActionsEventArgs)
Raises the SuggestedActionReported event.
Declaration
protected virtual void OnSuggestedActionReported(SuggestedActionsEventArgs suggestedActionsArgs)
Parameters
suggestedActionsArgs
OnUserVoted(UserVotedEventArgs)
Raises the UserVoted event.
Declaration
protected virtual void OnUserVoted(UserVotedEventArgs args)
Parameters
args
The event arguments.
RebindDataSource()
Rebinds the RadChat, using the collection set as DataSource.
Declaration
protected virtual void RebindDataSource()
RemoveMessage(MessageBase)
Removes an existing inline message from RadChat.
Declaration
public virtual void RemoveMessage(MessageBase message)
Parameters
message
Implements
ShowMessageInOverlay(MessageBase)
Adds a message as overlay content.
Declaration
protected void ShowMessageInOverlay(MessageBase message)
Parameters
message
ShowMessageInPopup(MessageBase)
Adds a message as popup content.
Declaration
protected void ShowMessageInPopup(MessageBase message)
Parameters
message
Events
AddingTimeBreak
Event is raised when time break is added.
Declaration
public event EventHandler<TimeBreakEventArgs> AddingTimeBreak
Event Value
RegenerateResponse
Occurs when a response needs to be regenerated.
Declaration
public event EventHandler<RegenerateResponseEventArgs> RegenerateResponse
Event Value
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.
ReportMessageResult
Event is raised when response action reports result.
Declaration
public event EventHandler<MessageResultEventArgs> ReportMessageResult
Event Value
SendMessage
Event is raised when a new message is typed and sent by the current author.
Declaration
public event EventHandler<SendMessageEventArgs> SendMessage
Event Value
SuggestedActionReported
Event is raised when suggested action reports result.
Declaration
public event EventHandler<SuggestedActionsEventArgs> SuggestedActionReported
Event Value
UserVoted
Occurs when a user votes (e.g., upvote or downvote) on a message.
Declaration
public event EventHandler<UserVotedEventArgs> UserVoted
Event Value