ClassRadPromptInputElement
TPF element implementing the an element that can be used to prompt and input. Acts as a coordinator between the PromptInputAttachedFilesElement, PromptInputTextBoxElement, and PromptInputButtonsPanelElement. Manages text synchronization, send flow orchestration, layout mode switching, and speech-to-text integration.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadPromptInputElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementRadPromptInputElement
Implements:
Inherited Members
Constructors
RadPromptInputElement()
Initializes a new instance of the RadPromptInputElement class.
Declaration
public RadPromptInputElement()
Fields
IsProcessingProperty
Identifies the IsProcessing property.
Declaration
public static RadProperty IsProcessingProperty
Field Value
Properties
AcceptsReturn
Gets or sets a value indicating whether the input box accepts the Return key to create new lines.
AttachedFiles
Gets the collection of files attached to the prompt. The collection is owned by the underlying PromptInputAttachedFilesElement; adding or removing items automatically updates the chip UI and the send-button state.
Declaration
[Browsable(false)]
public ObservableCollection<PromptInputAttachedFile> AttachedFiles { get; }
Property Value
AttachedFilesElement
Gets the attached files element.
Declaration
[Browsable(false)]
public PromptInputAttachedFilesElement AttachedFilesElement { get; }
Property Value
ButtonsPanelElement
Gets the buttons panel element.
Declaration
[Browsable(false)]
public PromptInputButtonsPanelElement ButtonsPanelElement { get; }
Property Value
EmptyPromptSuggestionsText
Gets or sets the text displayed inside the prompt-suggestions popup when both
SuggestedPrompts and RecentPrompts are empty.
When null or empty, the popup does not open when there are no suggestions.
Forwarded to EmptyPromptSuggestionsText.
Declaration
public string EmptyPromptSuggestionsText { get; set; }
Property Value
FileIconProvider
Gets or sets a callback that resolves the icon shown next to an attached file.
The callback receives the file name and returns a PromptInputFileIcon
carrying a glyph character, a Image, or a
RadSvgImage. Return null to fall back
to the default extension-based glyph.
Forwarded to FileIconProvider.
Declaration
[Browsable(false)]
public Func<string, PromptInputFileIcon> FileIconProvider { get; set; }
Property Value
InputRow
Gets the input row dock layout panel.
Declaration
[Browsable(false)]
public DockLayoutPanel InputRow { get; }
Property Value
InputTextBox
Gets the input text box element.
Declaration
[Browsable(false)]
public ChatInputTextBoxElement InputTextBox { get; }
Property Value
IsProcessing
Gets or sets a value indicating whether the control is in a processing state.
When true, clicking the send button raises CancelProcessing
instead of SendMessage. The same state is currently also reused
during speech-to-text listening.
MaxInputLines
Gets or sets the maximum number of visible lines in the input text box.
MoreButtonActions
Gets or sets the list of actions shown in the "more" button popup. Forwarded to MoreButtonActions.
Declaration
[Browsable(false)]
public IList<PromptInputButtonAction> MoreButtonActions { get; set; }
Property Value
IList<PromptInputButtonAction>
NullText
Gets or sets the prompt text that is displayed when the input text box is empty.
OpenPromptSuggestionsOnFocus
Gets or sets a value indicating whether the suggestions popup opens automatically
when the input text box gains keyboard focus. Default is false.
Declaration
public bool OpenPromptSuggestionsOnFocus { get; set; }
Property Value
RecentPrompts
Gets or sets the list of recent prompts shown in the suggestions popup. Forwarded to RecentPrompts.
Declaration
[Browsable(false)]
public IList<string> RecentPrompts { get; set; }
Property Value
IList<string>
ShowClearButton
Gets or sets a value indicating whether the clear button is visible when text is present.
ShowMoreButton
Gets or sets a value indicating whether the "more" button is visible.
ShowPromptSuggestionsButton
Gets or sets a value indicating whether the prompt-suggestions button is visible. Forwarded to ShowPromptSuggestionsButton.
Declaration
public bool ShowPromptSuggestionsButton { get; set; }
Property Value
ShowRecentPrompts
Gets or sets a value indicating whether the recent-prompts section is visible inside the suggestions popup.
ShowSpeechToTextButton
Gets or sets a value indicating whether the speech-to-text button is visible.
ShowSuggestedPrompts
Gets or sets a value indicating whether the suggested-prompts section is visible inside the suggestions popup.
SuggestedPrompts
Gets or sets the list of suggested prompts shown in the suggestions popup. Forwarded to SuggestedPrompts.
Declaration
[Browsable(false)]
public IList<string> SuggestedPrompts { get; set; }
Property Value
IList<string>
Methods
AttachFiles()
Opens the file attachment dialog for all file types. Forwarded to AttachFiles().
Declaration
public void AttachFiles()
AttachPhotos()
Opens the file attachment dialog for image file types. Forwarded to AttachPhotos().
Declaration
public void AttachPhotos()
CreateAttachedFilesElement()
Creates the attached files element. Override to customize.
Declaration
protected virtual PromptInputAttachedFilesElement CreateAttachedFilesElement()
Returns
CreateButtonsPanelElement()
Creates the buttons panel element. Override to customize.
Declaration
protected virtual PromptInputButtonsPanelElement CreateButtonsPanelElement()
Returns
CreateChildElements()
Called by the element when constructed. Allows inheritors to build the element tree.
Declaration
protected override void CreateChildElements()
Overrides
CreateInputBox()
Creates the input text box element. Override to customize.
Declaration
protected virtual ChatInputTextBoxElement CreateInputBox()
Returns
CreateInputRow()
Creates the input row panel. Override to customize.
Declaration
protected virtual DockLayoutPanel CreateInputRow()
Returns
CreateStackLayoutElement()
Creates the main stack layout element. Override to customize.
Declaration
protected virtual StackLayoutElement CreateStackLayoutElement()
Returns
DisposeManagedResources()
Disposes of managed resources including cached images and SVG images when the element is being disposed.
Declaration
protected override void DisposeManagedResources()
Overrides
InitializeFields()
Initializes the internal fields and components of the LightVisualElement. This method sets up text primitives, image primitives, and layout management components.
Declaration
protected override void InitializeFields()
Overrides
OnCancelProcessing(EventArgs)
Raises the CancelProcessing event.
Declaration
protected virtual void OnCancelProcessing(EventArgs args)
Parameters
args
OnPropertyChanged(RadPropertyChangedEventArgs)
Handles property change events by invalidating the fill cache and invoking the base class property change handler.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
Event arguments containing information about the property that changed.
Overrides
OnSendMessage(PromptInputSendMessageEventArgs)
Raises the SendMessage event.
Declaration
protected virtual void OnSendMessage(PromptInputSendMessageEventArgs args)
Parameters
args
OnSendingMessage(PromptInputSendingMessageEventArgs)
Raises the SendingMessage event.
Declaration
protected virtual void OnSendingMessage(PromptInputSendingMessageEventArgs args)
Parameters
args
RemoveAttachedFile(PromptInputAttachedFile)
Removes the specified file from the AttachedFiles collection. Raises AttachedFileRemoving beforehand (cancelable) and AttachedFileRemoved afterwards. Forwarded to RemoveAttachedFile(PromptInputAttachedFile).
Declaration
public void RemoveAttachedFile(PromptInputAttachedFile file)
Parameters
file
Events
AttachedFileRemoved
Occurs after an attached file has been removed from the AttachedFiles collection. Forwarded from AttachedFileRemoved.
Declaration
public event PromptInputAttachedFileRemovedEventHandler AttachedFileRemoved
Event Value
AttachedFileRemoving
Occurs before an attached file is removed as a result of the user clicking
the remove button on its chip. Set
Cancel to true to
keep the file in the AttachedFiles collection.
Forwarded from AttachedFileRemoving.
Declaration
public event PromptInputAttachedFileRemovingEventHandler AttachedFileRemoving
Event Value
AttachedFilesChanged
Occurs after the AttachedFiles collection changes (file added or removed, from the built-in dialog or programmatically). Forwarded from AttachedFilesChanged.
Declaration
public event EventHandler AttachedFilesChanged
Event Value
CancelProcessing
Occurs when the user clicks the send button while the control is in a processing state.
DialogOpening
Occurs when a file dialog is about to open (Attach / Photo actions).
Set Cancel to true
to suppress the built-in OpenFileDialog and
handle file selection externally; populate
FileNames in that case to still
produce attachments. Forwarded from DialogOpening.
Declaration
public event PromptInputDialogOpeningEventHandler DialogOpening
Event Value
PromptSuggestionSelected
Occurs when the user selects an item from the prompt suggestions popup. Forwarded from SuggestionSelected.
Declaration
public event PromptInputSuggestionSelectedEventHandler PromptSuggestionSelected
Event Value
SendMessage
Occurs when the user sends a message via the send button.
Declaration
public event PromptInputSendMessageEventHandler SendMessage
Event Value
SendingMessage
Occurs before a message is sent. Set Cancel to true to prevent sending.
Declaration
public event PromptInputSendingMessageEventHandler SendingMessage
Event Value
SuggestionSelecting
Occurs before a suggestion is applied to the input text.
Set Cancel to true
to prevent the suggestion from being applied.
Forwarded from SuggestionSelecting.
Declaration
public event PromptInputSuggestionSelectingEventHandler SuggestionSelecting
Event Value