RadPromptInput
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
Initializes a new instance of the RadPromptInput class.
public RadPromptInput()
Fields
AcceptsReturnProperty
DependencyProperty
Identifies the AcceptsReturn dependency property.
public static readonly DependencyProperty AcceptsReturnProperty
AttachedFilesProperty
DependencyProperty
Identifies the AttachedFiles dependency property.
public static readonly DependencyProperty AttachedFilesProperty
AttachmentTemplateProperty
DependencyProperty
Identifies the AttachmentTemplate dependency property.
public static readonly DependencyProperty AttachmentTemplateProperty
AttachmentTemplateSelectorProperty
DependencyProperty
Identifies the AttachmentTemplateSelector dependency property.
public static readonly DependencyProperty AttachmentTemplateSelectorProperty
CancelProcessingCommandProperty
DependencyProperty
Identifies the CancelProcessingCommand dependency property.
public static readonly DependencyProperty CancelProcessingCommandProperty
CancelProcessingEvent
RoutedEvent
Identifies the CancelProcessing routed event.
public static readonly RoutedEvent CancelProcessingEvent
DialogOpeningEvent
RoutedEvent
Identifies the DialogOpening routed event.
public static readonly RoutedEvent DialogOpeningEvent
FileIconGlyphConverterProperty
DependencyProperty
Identifies the FileIconGlyphConverter dependency property.
public static readonly DependencyProperty FileIconGlyphConverterProperty
HasPromptSuggestionsProperty
DependencyProperty
Identifies the HasPromptSuggestions dependency property.
public static readonly DependencyProperty HasPromptSuggestionsProperty
HasRecentPromptsProperty
DependencyProperty
Identifies the HasRecentPrompts dependency property.
public static readonly DependencyProperty HasRecentPromptsProperty
HasSuggestedPromptsProperty
DependencyProperty
Identifies the HasSuggestedPrompts dependency property.
public static readonly DependencyProperty HasSuggestedPromptsProperty
IsMoreButtonVisibleProperty
DependencyProperty
Identifies the IsMoreButtonVisible dependency property.
public static readonly DependencyProperty IsMoreButtonVisibleProperty
IsProcessingProperty
DependencyProperty
Identifies the IsProcessing dependency property.
public static readonly DependencyProperty IsProcessingProperty
IsPromptSuggestionsButtonVisibleProperty
DependencyProperty
Identifies the IsPromptSuggestionsButtonVisible dependency property.
public static readonly DependencyProperty IsPromptSuggestionsButtonVisibleProperty
IsRecentPromptsVisibleProperty
DependencyProperty
Identifies the IsRecentPromptsVisible dependency property.
public static readonly DependencyProperty IsRecentPromptsVisibleProperty
IsSpeechToTextButtonVisibleProperty
DependencyProperty
Identifies the IsSpeechToTextButtonVisible dependency property.
public static readonly DependencyProperty IsSpeechToTextButtonVisibleProperty
IsSuggestedPromptsVisibleProperty
DependencyProperty
Identifies the IsSuggestedPromptsVisible dependency property.
public static readonly DependencyProperty IsSuggestedPromptsVisibleProperty
MaxInputLinesProperty
DependencyProperty
Identifies the MaxInputLines dependency property.
public static readonly DependencyProperty MaxInputLinesProperty
MoreButtonActionsItemTemplateProperty
DependencyProperty
Identifies the MoreButtonActionsItemTemplate dependency property.
public static readonly DependencyProperty MoreButtonActionsItemTemplateProperty
MoreButtonActionsItemTemplateSelectorProperty
DependencyProperty
Identifies the MoreButtonActionsItemTemplateSelector dependency property.
public static readonly DependencyProperty MoreButtonActionsItemTemplateSelectorProperty
MoreButtonActionsProperty
DependencyProperty
Identifies the MoreButtonActions dependency property.
public static readonly DependencyProperty MoreButtonActionsProperty
OpenPromptSuggestionsOnFocusProperty
DependencyProperty
Identifies the OpenPromptSuggestionsOnFocus dependency property.
public static readonly DependencyProperty OpenPromptSuggestionsOnFocusProperty
PromptSuggestionSelectedEvent
RoutedEvent
Identifies the PromptSuggestionSelected routed event.
public static readonly RoutedEvent PromptSuggestionSelectedEvent
PromptSuggestionsEmptyContentProperty
DependencyProperty
Identifies the PromptSuggestionsEmptyContent dependency property.
public static readonly DependencyProperty PromptSuggestionsEmptyContentProperty
PromptSuggestionsEmptyContentTemplateProperty
DependencyProperty
Identifies the PromptSuggestionsEmptyContentTemplate dependency property.
public static readonly DependencyProperty PromptSuggestionsEmptyContentTemplateProperty
RecentPromptsProperty
DependencyProperty
Identifies the RecentPrompts dependency property.
public static readonly DependencyProperty RecentPromptsProperty
RemoveAttachedFileCommandProperty
DependencyProperty
Identifies the RemoveAttachedFileCommand dependency property.
public static readonly DependencyProperty RemoveAttachedFileCommandProperty
SendButtonContentProperty
DependencyProperty
Identifies the SendButtonContent dependency property.
public static readonly DependencyProperty SendButtonContentProperty
SendButtonContentTemplateProperty
DependencyProperty
Identifies the SendButtonContentTemplate dependency property.
public static readonly DependencyProperty SendButtonContentTemplateProperty
SendMessageCommandProperty
DependencyProperty
Identifies the SendMessageCommand dependency property.
public static readonly DependencyProperty SendMessageCommandProperty
SendMessageEvent
RoutedEvent
Identifies the SendMessage routed event.
public static readonly RoutedEvent SendMessageEvent
ShowClearButtonProperty
DependencyProperty
Identifies the ShowClearButton dependency property.
public static readonly DependencyProperty ShowClearButtonProperty
SuggestedPromptsProperty
DependencyProperty
Identifies the SuggestedPrompts dependency property.
public static readonly DependencyProperty SuggestedPromptsProperty
TextProperty
DependencyProperty
Identifies the Text dependency property.
public static readonly DependencyProperty TextProperty
WatermarkContentProperty
DependencyProperty
Identifies the WatermarkContent dependency property.
public static readonly DependencyProperty WatermarkContentProperty
Properties
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.
public bool AcceptsReturn { get; set; }
Gets the collection of attached items displayed above the input area. Items are rendered using AttachmentTemplate or AttachmentTemplateSelector.
public ObservableCollection<PromptInputAttachedFile> AttachedFiles { get; }
AttachmentTemplate
DataTemplate
Gets or sets the data template used to display each attachment item.
public DataTemplate AttachmentTemplate { get; set; }
AttachmentTemplateSelector
DataTemplateSelector
Gets or sets the data template selector used to choose the template for each attachment item.
public DataTemplateSelector AttachmentTemplateSelector { get; set; }
Gets or sets the command that is executed to cancel an ongoing operation
when the user clicks the send button while IsProcessing is true.
public ICommand CancelProcessingCommand { get; set; }
FileIconGlyphConverter
IValueConverter
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.
public IValueConverter FileIconGlyphConverter { get; set; }
Gets a value indicating whether there are any suggested or recent prompts available.
public bool HasPromptSuggestions { get; }
Gets a value indicating whether the RecentPrompts collection contains any items.
public bool HasRecentPrompts { get; }
Gets a value indicating whether the SuggestedPrompts collection contains any items.
public bool HasSuggestedPrompts { get; }
Gets or sets a value indicating whether the more button is visible.
public bool IsMoreButtonVisible { get; set; }
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.
public bool IsProcessing { get; set; }
Gets or sets a value indicating whether the prompt suggestions button is visible.
public bool IsPromptSuggestionsButtonVisible { get; set; }
Gets or sets a value indicating whether the recent prompts section is visible in the suggestions popup.
public bool IsRecentPromptsVisible { get; set; }
Gets or sets a value indicating whether the speech-to-text button is visible.
public bool IsSpeechToTextButtonVisible { get; set; }
Gets or sets a value indicating whether the suggested prompts section is visible in the suggestions popup.
public bool IsSuggestedPromptsVisible { get; set; }
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.
public int MaxInputLines { get; set; }
Gets or sets the collection of action items displayed in the more button popup.
public ObservableCollection<PromptInputButtonAction> MoreButtonActions { get; set; }
MoreButtonActionsItemTemplate
DataTemplate
Gets or sets the data template used to display each action item in the more button dropdown.
public DataTemplate MoreButtonActionsItemTemplate { get; set; }
MoreButtonActionsItemTemplateSelector
DataTemplateSelector
Gets or sets the data template selector used to choose a template for each action item in the more button dropdown.
public DataTemplateSelector MoreButtonActionsItemTemplateSelector { get; set; }
Gets or sets a value indicating whether the suggestions popup opens when the input receives focus.
public bool OpenPromptSuggestionsOnFocus { get; set; }
Gets or sets the content displayed in the prompt suggestions dropdown when there are no suggested or recent prompts available.
public object PromptSuggestionsEmptyContent { get; set; }
PromptSuggestionsEmptyContentTemplate
DataTemplate
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.
public DataTemplate PromptSuggestionsEmptyContentTemplate { get; set; }
Gets or sets the collection of recent prompts displayed in the suggestions popup.
public ObservableCollection<string> RecentPrompts { get; set; }
Gets or sets the command that is executed to remove an attached file. The command parameter is the attached file item to remove.
public ICommand RemoveAttachedFileCommand { get; set; }
Gets or sets the content to display inside the send button. When set, this replaces the default send/stop glyph icons.
public object SendButtonContent { get; set; }
SendButtonContentTemplate
DataTemplate
Gets or sets the data template used to display the SendButtonContent.
public DataTemplate SendButtonContentTemplate { get; set; }
Gets or sets the command that is executed when the send button is clicked or Enter is pressed.
public ICommand SendMessageCommand { get; set; }
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.
public bool ShowClearButton { get; set; }
Gets or sets the collection of suggested prompts displayed in the suggestions popup.
public ObservableCollection<string> SuggestedPrompts { get; set; }
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.
public string Text { get; set; }
Gets or sets the watermark (placeholder) content displayed when the input box is empty.
public object WatermarkContent { get; set; }
Methods
public override void OnApplyTemplate()
Raises the CancelProcessing routed event.
protected virtual void OnCancelProcessing(RoutedEventArgs args)
The event data.
Raises the DialogOpening routed event.
protected virtual void OnDialogOpening(PromptInputDialogOpeningEventArgs args)
The event data.
Raises the PromptSuggestionSelected routed event.
protected virtual void OnPromptSuggestionSelected(PromptInputSuggestionSelectedEventArgs args)
The event data.
Raises the SendMessage routed event.
protected virtual void OnSendMessage(PromptInputSendMessageEventArgs args)
The event data.
Events
CancelProcessing
EventHandler<RoutedEventArgs>
Occurs when the user clicks the send button while the control is in a processing state, requesting cancellation of the current operation.
public event EventHandler<RoutedEventArgs> CancelProcessing
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.
public event EventHandler<PromptInputDialogOpeningEventArgs> DialogOpening
Occurs when the user selects a suggestion from the prompt suggestions dropdown.
public event EventHandler<PromptInputSuggestionSelectedEventArgs> PromptSuggestionSelected
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.
public event EventHandler<PromptInputSendMessageEventArgs> SendMessage