ClassRadPromptInput
Represents a smart input control for composing and sending messages with support for attachments, speech-to-text, popup actions. Designed to be used within a RadChat or as a standalone input component.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.dll
Syntax:
public class RadPromptInput : Control
Inheritance: objectRadPromptInput
Constructors
RadPromptInput()
Initializes a new instance of the RadPromptInput class.
Declaration
public RadPromptInput()
Fields
AcceptsReturnProperty
Identifies the AcceptsReturn dependency property.
Declaration
public static readonly DependencyProperty AcceptsReturnProperty
Field Value
DependencyProperty
AttachedFilesProperty
Identifies the AttachedFiles dependency property.
Declaration
public static readonly DependencyProperty AttachedFilesProperty
Field Value
DependencyProperty
AttachmentTemplateProperty
Identifies the AttachmentTemplate dependency property.
Declaration
public static readonly DependencyProperty AttachmentTemplateProperty
Field Value
DependencyProperty
AttachmentTemplateSelectorProperty
Identifies the AttachmentTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty AttachmentTemplateSelectorProperty
Field Value
DependencyProperty
CancelProcessingCommandProperty
Identifies the CancelProcessingCommand dependency property.
Declaration
public static readonly DependencyProperty CancelProcessingCommandProperty
Field Value
DependencyProperty
CancelProcessingEvent
Identifies the CancelProcessing routed event.
Declaration
public static readonly RoutedEvent CancelProcessingEvent
Field Value
RoutedEvent
DialogOpeningEvent
Identifies the DialogOpening routed event.
Declaration
public static readonly RoutedEvent DialogOpeningEvent
Field Value
RoutedEvent
FileIconGlyphConverterProperty
Identifies the FileIconGlyphConverter dependency property.
Declaration
public static readonly DependencyProperty FileIconGlyphConverterProperty
Field Value
DependencyProperty
HasPromptSuggestionsProperty
Identifies the HasPromptSuggestions dependency property.
Declaration
public static readonly DependencyProperty HasPromptSuggestionsProperty
Field Value
DependencyProperty
HasRecentPromptsProperty
Identifies the HasRecentPrompts dependency property.
Declaration
public static readonly DependencyProperty HasRecentPromptsProperty
Field Value
DependencyProperty
HasSuggestedPromptsProperty
Identifies the HasSuggestedPrompts dependency property.
Declaration
public static readonly DependencyProperty HasSuggestedPromptsProperty
Field Value
DependencyProperty
IsMoreButtonVisibleProperty
Identifies the IsMoreButtonVisible dependency property.
Declaration
public static readonly DependencyProperty IsMoreButtonVisibleProperty
Field Value
DependencyProperty
IsProcessingProperty
Identifies the IsProcessing dependency property.
Declaration
public static readonly DependencyProperty IsProcessingProperty
Field Value
DependencyProperty
IsPromptSuggestionsButtonVisibleProperty
Identifies the IsPromptSuggestionsButtonVisible dependency property.
Declaration
public static readonly DependencyProperty IsPromptSuggestionsButtonVisibleProperty
Field Value
DependencyProperty
IsRecentPromptsVisibleProperty
Identifies the IsRecentPromptsVisible dependency property.
Declaration
public static readonly DependencyProperty IsRecentPromptsVisibleProperty
Field Value
DependencyProperty
IsSpeechToTextButtonVisibleProperty
Identifies the IsSpeechToTextButtonVisible dependency property.
Declaration
public static readonly DependencyProperty IsSpeechToTextButtonVisibleProperty
Field Value
DependencyProperty
IsSuggestedPromptsVisibleProperty
Identifies the IsSuggestedPromptsVisible dependency property.
Declaration
public static readonly DependencyProperty IsSuggestedPromptsVisibleProperty
Field Value
DependencyProperty
MaxInputLinesProperty
Identifies the MaxInputLines dependency property.
Declaration
public static readonly DependencyProperty MaxInputLinesProperty
Field Value
DependencyProperty
MoreButtonActionsItemTemplateProperty
Identifies the MoreButtonActionsItemTemplate dependency property.
Declaration
public static readonly DependencyProperty MoreButtonActionsItemTemplateProperty
Field Value
DependencyProperty
MoreButtonActionsItemTemplateSelectorProperty
Identifies the MoreButtonActionsItemTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty MoreButtonActionsItemTemplateSelectorProperty
Field Value
DependencyProperty
MoreButtonActionsProperty
Identifies the MoreButtonActions dependency property.
Declaration
public static readonly DependencyProperty MoreButtonActionsProperty
Field Value
DependencyProperty
OpenPromptSuggestionsOnFocusProperty
Identifies the OpenPromptSuggestionsOnFocus dependency property.
Declaration
public static readonly DependencyProperty OpenPromptSuggestionsOnFocusProperty
Field Value
DependencyProperty
PromptSuggestionSelectedEvent
Identifies the PromptSuggestionSelected routed event.
Declaration
public static readonly RoutedEvent PromptSuggestionSelectedEvent
Field Value
RoutedEvent
PromptSuggestionsEmptyContentProperty
Identifies the PromptSuggestionsEmptyContent dependency property.
Declaration
public static readonly DependencyProperty PromptSuggestionsEmptyContentProperty
Field Value
DependencyProperty
PromptSuggestionsEmptyContentTemplateProperty
Identifies the PromptSuggestionsEmptyContentTemplate dependency property.
Declaration
public static readonly DependencyProperty PromptSuggestionsEmptyContentTemplateProperty
Field Value
DependencyProperty
RecentPromptsProperty
Identifies the RecentPrompts dependency property.
Declaration
public static readonly DependencyProperty RecentPromptsProperty
Field Value
DependencyProperty
RemoveAttachedFileCommandProperty
Identifies the RemoveAttachedFileCommand dependency property.
Declaration
public static readonly DependencyProperty RemoveAttachedFileCommandProperty
Field Value
DependencyProperty
SendButtonContentProperty
Identifies the SendButtonContent dependency property.
Declaration
public static readonly DependencyProperty SendButtonContentProperty
Field Value
DependencyProperty
SendButtonContentTemplateProperty
Identifies the SendButtonContentTemplate dependency property.
Declaration
public static readonly DependencyProperty SendButtonContentTemplateProperty
Field Value
DependencyProperty
SendMessageCommandProperty
Identifies the SendMessageCommand dependency property.
Declaration
public static readonly DependencyProperty SendMessageCommandProperty
Field Value
DependencyProperty
SendMessageEvent
Identifies the SendMessage routed event.
Declaration
public static readonly RoutedEvent SendMessageEvent
Field Value
RoutedEvent
ShowClearButtonProperty
Identifies the ShowClearButton dependency property.
Declaration
public static readonly DependencyProperty ShowClearButtonProperty
Field Value
DependencyProperty
SuggestedPromptsProperty
Identifies the SuggestedPrompts dependency property.
Declaration
public static readonly DependencyProperty SuggestedPromptsProperty
Field Value
DependencyProperty
TextProperty
Identifies the Text dependency property.
Declaration
public static readonly DependencyProperty TextProperty
Field Value
DependencyProperty
WatermarkContentProperty
Identifies the WatermarkContent dependency property.
Declaration
public static readonly DependencyProperty WatermarkContentProperty
Field Value
DependencyProperty
Properties
AcceptsReturn
Gets or sets a value indicating whether the input box accepts the Return key to create new lines.
When false, pressing Enter triggers the SendMessageCommand.
AttachedFiles
Gets the collection of attached items displayed above the input area. Items are rendered using AttachmentTemplate or AttachmentTemplateSelector.
Declaration
public ObservableCollection<PromptInputAttachedFile> AttachedFiles { get; }
Property Value
AttachmentTemplate
Gets or sets the data template used to display each attachment item.
Declaration
public DataTemplate AttachmentTemplate { get; set; }
Property Value
DataTemplate
AttachmentTemplateSelector
Gets or sets the data template selector used to choose the template for each attachment item.
Declaration
public DataTemplateSelector AttachmentTemplateSelector { get; set; }
Property Value
DataTemplateSelector
CancelProcessingCommand
Gets or sets the command that is executed to cancel an ongoing operation
when the user clicks the send button while IsProcessing is true.
Declaration
public ICommand CancelProcessingCommand { get; set; }
Property Value
FileIconGlyphConverter
Gets or sets the IValueConverter used to convert a file name to a glyph character for display in the attachment area. The converter receives the FileName and should return a single glyph character string. The default value is set to a FileExtensionToGlyphConverter instance via the default style.
Declaration
public IValueConverter FileIconGlyphConverter { get; set; }
Property Value
IValueConverter
HasPromptSuggestions
Gets a value indicating whether there are any suggested or recent prompts available.
HasRecentPrompts
Gets a value indicating whether the RecentPrompts collection contains any items.
HasSuggestedPrompts
Gets a value indicating whether the SuggestedPrompts collection contains any items.
IsMoreButtonVisible
Gets or sets a value indicating whether the more button is visible.
IsProcessing
Gets or sets a value indicating whether the control is in a processing state
(e.g., waiting for an AI response). When true, the send button switches
to a stop icon and executes CancelProcessingCommand instead of SendMessageCommand.
IsPromptSuggestionsButtonVisible
Gets or sets a value indicating whether the prompt suggestions button is visible.
Declaration
public bool IsPromptSuggestionsButtonVisible { get; set; }
Property Value
IsRecentPromptsVisible
Gets or sets a value indicating whether the recent prompts section is visible in the suggestions popup.
IsSpeechToTextButtonVisible
Gets or sets a value indicating whether the speech-to-text button is visible.
Declaration
public bool IsSpeechToTextButtonVisible { get; set; }
Property Value
IsSuggestedPromptsVisible
Gets or sets a value indicating whether the suggested prompts section is visible in the suggestions popup.
Declaration
public bool IsSuggestedPromptsVisible { get; set; }
Property Value
MaxInputLines
Gets or sets the maximum number of visible lines in the input text box. The default value is 5. The text box will scroll vertically when content exceeds this limit.
MoreButtonActions
Gets or sets the collection of action items displayed in the more button popup.
Declaration
public ObservableCollection<PromptInputButtonAction> MoreButtonActions { get; set; }
Property Value
MoreButtonActionsItemTemplate
Gets or sets the data template used to display each action item in the more button dropdown.
Declaration
public DataTemplate MoreButtonActionsItemTemplate { get; set; }
Property Value
DataTemplate
MoreButtonActionsItemTemplateSelector
Gets or sets the data template selector used to choose a template for each action item in the more button dropdown.
Declaration
public DataTemplateSelector MoreButtonActionsItemTemplateSelector { get; set; }
Property Value
DataTemplateSelector
OpenPromptSuggestionsOnFocus
Gets or sets a value indicating whether the suggestions popup opens when the input receives focus.
Declaration
public bool OpenPromptSuggestionsOnFocus { get; set; }
Property Value
PromptSuggestionsEmptyContent
Gets or sets the content displayed in the prompt suggestions dropdown when there are no suggested or recent prompts available.
Declaration
public object PromptSuggestionsEmptyContent { get; set; }
Property Value
PromptSuggestionsEmptyContentTemplate
Gets or sets the data template used to display the empty state content in the prompt suggestions dropdown when there are no suggested or recent prompts available.
Declaration
public DataTemplate PromptSuggestionsEmptyContentTemplate { get; set; }
Property Value
DataTemplate
RecentPrompts
Gets or sets the collection of recent prompts displayed in the suggestions popup.
Declaration
public ObservableCollection<string> RecentPrompts { get; set; }
Property Value
RemoveAttachedFileCommand
Gets or sets the command that is executed to remove an attached file. The command parameter is the attached file item to remove.
Declaration
public ICommand RemoveAttachedFileCommand { get; set; }
Property Value
SendButtonContent
Gets or sets the content to display inside the send button. When set, this replaces the default send/stop glyph icons.
SendButtonContentTemplate
Gets or sets the data template used to display the SendButtonContent.
Declaration
public DataTemplate SendButtonContentTemplate { get; set; }
Property Value
DataTemplate
SendMessageCommand
Gets or sets the command that is executed when the send button is clicked or Enter is pressed.
Declaration
public ICommand SendMessageCommand { get; set; }
Property Value
ShowClearButton
Gets or sets a value indicating whether the clear button is visible.
When true, a clear (X) button appears next to the input box whenever Text is not empty.
SuggestedPrompts
Gets or sets the collection of suggested prompts displayed in the suggestions popup.
Declaration
public ObservableCollection<string> SuggestedPrompts { get; set; }
Property Value
Text
Gets or sets the text content of the input box. This property binds two-way to the inner text box and updates on every keystroke.
WatermarkContent
Gets or sets the watermark (placeholder) content displayed when the input box is empty.
Methods
OnApplyTemplate()
Declaration
public override void OnApplyTemplate()
OnCancelProcessing(RoutedEventArgs)
Raises the CancelProcessing routed event.
Declaration
protected virtual void OnCancelProcessing(RoutedEventArgs args)
Parameters
args
RoutedEventArgs
The event data.
OnDialogOpening(PromptInputDialogOpeningEventArgs)
Raises the DialogOpening routed event.
Declaration
protected virtual void OnDialogOpening(PromptInputDialogOpeningEventArgs args)
Parameters
args
PromptInputDialogOpeningEventArgs
The event data.
OnInitialized(EventArgs)
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
OnPromptSuggestionSelected(PromptInputSuggestionSelectedEventArgs)
Raises the PromptSuggestionSelected routed event.
Declaration
protected virtual void OnPromptSuggestionSelected(PromptInputSuggestionSelectedEventArgs args)
Parameters
args
PromptInputSuggestionSelectedEventArgs
The event data.
OnSendMessage(PromptInputSendMessageEventArgs)
Raises the SendMessage routed event.
Declaration
protected virtual void OnSendMessage(PromptInputSendMessageEventArgs args)
Parameters
args
PromptInputSendMessageEventArgs
The event data.
Events
CancelProcessing
Occurs when the user clicks the send button while the control is in a processing state, requesting cancellation of the current operation.
Declaration
public event EventHandler<RoutedEventArgs> CancelProcessing
Event Value
EventHandler<RoutedEventArgs>
DialogOpening
Occurs when a file dialog is about to open. Set Cancel to true
to suppress the default dialog and handle file selection externally (e.g., using RadOpenFileDialog).
When canceled, populate FileNames with the selected paths.
Declaration
public event EventHandler<PromptInputDialogOpeningEventArgs> DialogOpening
Event Value
PromptSuggestionSelected
Occurs when the user selects a suggestion from the prompt suggestions dropdown.
Declaration
public event EventHandler<PromptInputSuggestionSelectedEventArgs> PromptSuggestionSelected
Event Value
SendMessage
Occurs when the user sends a message via the send button or the Enter key. The event args contain a snapshot of the input text and attached files.
Declaration
public event EventHandler<PromptInputSendMessageEventArgs> SendMessage
Event Value