ClassRadPromptInput
Represents a comprehensive prompt input control designed for creating and managing AI prompts. This control provides a rich text input experience with integrated functionality including a send button for message submission, speech-to-text capabilities for voice input, file attachment support for sharing documents and images, and a customizable 'More' button with extensible actions. The control supports both compact and expanded display modes, automatically adapting its layout based on user interaction and content state. It includes built-in commands for common operations such as picking files, selecting photos, and capturing images with the camera, while also allowing developers to define custom actions and styling to match their application's design requirements.
Definition
Namespace:Telerik.Maui.Controls
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class RadPromptInput : RadBorderContentView, IRadContentView, IContentView, IView, IElement, ITransform, IPadding, ICrossPlatformLayout
Inheritance: objectRadContentViewRadCompositeContentViewRadBorderContentViewRadPromptInput
Implements:
Inherited Members
Constructors
RadPromptInput()
Initializes a new instance of the RadPromptInput class.
Declaration
public RadPromptInput()
Fields
ActualRemoveAttachedFileCommandProperty
Identifies the ActualRemoveAttachedFileCommand property.
Declaration
public static readonly BindableProperty ActualRemoveAttachedFileCommandProperty
Field Value
BindableProperty
AttachedFilesProperty
Identifies the AttachedFiles property.
Declaration
public static readonly BindableProperty AttachedFilesProperty
Field Value
BindableProperty
AutoGenerateMoreButtonActionsProperty
Identifies the AutoGenerateMoreButtonActions property.
Declaration
public static readonly BindableProperty AutoGenerateMoreButtonActionsProperty
Field Value
BindableProperty
DisplayModeProperty
Identifies the DisplayMode property.
Declaration
public static readonly BindableProperty DisplayModeProperty
Field Value
BindableProperty
IsMoreButtonVisibleProperty
Identifies the IsMoreButtonVisible property.
Declaration
public static readonly BindableProperty IsMoreButtonVisibleProperty
Field Value
BindableProperty
IsSpeechToTextButtonVisibleProperty
Identifies the IsSpeechToTextButtonVisible property.
Declaration
public static readonly BindableProperty IsSpeechToTextButtonVisibleProperty
Field Value
BindableProperty
MaxInputLinesProperty
Identifies the MaxInputLines property.
Declaration
public static readonly BindableProperty MaxInputLinesProperty
Field Value
BindableProperty
MessageProperty
Identifies the Message property.
Declaration
public static readonly BindableProperty MessageProperty
Field Value
BindableProperty
MoreButtonActionsProperty
Identifies the MoreButtonActions property.
Declaration
public static readonly BindableProperty MoreButtonActionsProperty
Field Value
BindableProperty
MoreButtonStyleProperty
Identifies the MoreButtonStyle property.
Declaration
public static readonly BindableProperty MoreButtonStyleProperty
Field Value
BindableProperty
PickFileCommandProperty
Identifies the PickFileCommand property.
Declaration
public static readonly BindableProperty PickFileCommandProperty
Field Value
BindableProperty
PickFileTypesProperty
Identifies the PickFileTypes property.
Declaration
public static readonly BindableProperty PickFileTypesProperty
Field Value
BindableProperty
PickPhotoCommandProperty
Identifies the PickPhotoCommand property.
Declaration
public static readonly BindableProperty PickPhotoCommandProperty
Field Value
BindableProperty
PlaceholderColorProperty
Identifies the PlaceholderColor property.
Declaration
public static readonly BindableProperty PlaceholderColorProperty
Field Value
BindableProperty
PlaceholderProperty
Identifies the Placeholder property.
Declaration
public static readonly BindableProperty PlaceholderProperty
Field Value
BindableProperty
RemoveAttachedFileCommandProperty
Identifies the RemoveAttachedFileCommand property.
Declaration
public static readonly BindableProperty RemoveAttachedFileCommandProperty
Field Value
BindableProperty
SendButtonStyleProperty
Identifies the SendButtonStyle property.
Declaration
public static readonly BindableProperty SendButtonStyleProperty
Field Value
BindableProperty
SendMessageButtonImageProperty
Identifies the SendMessageButtonImage property.
Declaration
public static readonly BindableProperty SendMessageButtonImageProperty
Field Value
BindableProperty
SendMessageCommandProperty
Identifies the SendMessageCommand property.
Declaration
public static readonly BindableProperty SendMessageCommandProperty
Field Value
BindableProperty
SpeechToTextButtonStyleProperty
Identifies the SpeechToTextButtonStyle property.
Declaration
public static readonly BindableProperty SpeechToTextButtonStyleProperty
Field Value
BindableProperty
TakePhotoCommandProperty
Identifies the TakePhotoCommand property.
Declaration
public static readonly BindableProperty TakePhotoCommandProperty
Field Value
BindableProperty
TextColorProperty
Identifies the TextColor property.
Declaration
public static readonly BindableProperty TextColorProperty
Field Value
BindableProperty
Properties
ActualRemoveAttachedFileCommand
Gets the actual command that is executed when removing an attached file. This command will execute the custom RemoveAttachedFileCommand.
Declaration
public ICommand ActualRemoveAttachedFileCommand { get; }
Property Value
AttachedFiles
Gets or sets a collection that contains the currently attached files that have not yet been sent.
Declaration
public ICollection<PromptInputAttachedFile> AttachedFiles { get; set; }
Property Value
AutoGenerateMoreButtonActions
Gets or sets a value indicating whether to automatically generate default actions for the 'More' button.
Declaration
public bool AutoGenerateMoreButtonActions { get; set; }
Property Value
DisplayMode
Gets or sets the display mode for the PromptInput control. The default value is Automatic.
Declaration
public PromptInputDisplayMode DisplayMode { get; set; }
Property Value
IsMoreButtonVisible
Gets or sets a value indicating whether the 'More' button is visible in the text input area. When set to true, the 'More' button is displayed, allowing users to access additional actions such as attaching files or images. When set to false, the 'More' button is hidden and these actions are not accessible from the input area. The default value is false.
IsSpeechToTextButtonVisible
Gets or sets a value indicating whether the Speech-To-Text button is visible in the text input area. When set to true, the Speech-To-Text button is displayed, allowing users to dictate messages using speech recognition. When set to false, the button is hidden and speech-to-text functionality is not accessible from the input area.
Declaration
public bool IsSpeechToTextButtonVisible { get; set; }
Property Value
MaxInputLines
Gets or sets the maximum number of input lines allowed in the text input area. When the number of lines exceeds this value, the input area becomes scrollable. The default value is 5.
Message
Gets or sets the message that is typed in the input area.
MoreButtonActions
Gets or sets the collection of toolbar actions displayed in the input area more button.
Declaration
public IList<PromptInputButtonAction> MoreButtonActions { get; set; }
Property Value
MoreButtonStyle
Gets or sets a custom style that is to be applied to the 'More' button. The actual style that is applied is a merger between this style and the default style for the PromptInputMoreButtonToolbarItemView. The target type of this style is PromptInputMoreButtonToolbarItemView .
Declaration
public Style MoreButtonStyle { get; set; }
Property Value
Style
PickFileCommand
Gets or sets the command that opens the for attaching files for upload.
PickFileTypes
Gets or sets the type of files that can be attached in the UI that is shown when the end-user clicks the pick-file button (attach-files button).
Declaration
public FilePickerFileType PickFileTypes { get; set; }
Property Value
FilePickerFileType
PickPhotoCommand
Gets or sets the command that opens the for attaching photos for upload.
Declaration
public ICommand PickPhotoCommand { get; set; }
Property Value
Placeholder
Gets or sets the placeholder text displayed in the input area when it is empty.
PlaceholderColor
Gets or sets the placeholder color of the input area.
Declaration
public Color PlaceholderColor { get; set; }
Property Value
Color
RemoveAttachedFileCommand
Gets or sets the command that will be executed when removing an attached file from the RadPromptInput.
Declaration
public ICommand RemoveAttachedFileCommand { get; set; }
Property Value
SendButtonStyle
Gets or sets a custom style that is to be applied to the Send button. The actual style that is applied is a merger between this style and the default style for the Send button. The target type of this style is RadTemplatedButton.
Declaration
public Style SendButtonStyle { get; set; }
Property Value
Style
SendMessageButtonImage
Gets or sets the image for the send message button.
Declaration
public ImageSource SendMessageButtonImage { get; set; }
Property Value
ImageSource
SendMessageCommand
Gets or sets the custom command that will be executed when sending a message (when the Send message button is pressed or Enter is pressed). The parameter of this command is of type object and the value is the same as the Message property.
Declaration
public ICommand SendMessageCommand { get; set; }
Property Value
SpeechRecognizedCommand
Gets the command that is executed when speech is recognized by the speech-to-text button.
Declaration
public ICommand SpeechRecognizedCommand { get; }
Property Value
SpeechToTextButtonStyle
Gets or sets the style of the RadSpeechToTextButton in the RadPromptInput control. The actual style that is applied is a merger between this style and the default style for the RadSpeechToTextButton The target type of this style is RadSpeechToTextButton.
Declaration
public Style SpeechToTextButtonStyle { get; set; }
Property Value
Style
TakePhotoCommand
Gets or sets the command that opens the camera for attaching a photo.
Declaration
public ICommand TakePhotoCommand { get; set; }
Property Value
TextColor
Gets or sets the text color of the input area.
Declaration
public Color TextColor { get; set; }
Property Value
Color
Methods
Focus()
Attempts to set focus to this element.
OnApplyTemplate()
Declaration
protected override void OnApplyTemplate()
Overrides