RadPromptInput
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
Initializes a new instance of the RadPromptInput class.
public RadPromptInput()
Fields
ActualRemoveAttachedFileCommandProperty
BindableProperty
Identifies the ActualRemoveAttachedFileCommand property.
public static readonly BindableProperty ActualRemoveAttachedFileCommandProperty
AttachedFilesProperty
BindableProperty
Identifies the AttachedFiles property.
public static readonly BindableProperty AttachedFilesProperty
AutoGenerateMoreButtonActionsProperty
BindableProperty
Identifies the AutoGenerateMoreButtonActions property.
public static readonly BindableProperty AutoGenerateMoreButtonActionsProperty
DisplayModeProperty
BindableProperty
Identifies the DisplayMode property.
public static readonly BindableProperty DisplayModeProperty
EndAffixContentTemplateProperty
BindableProperty
Identifies the EndAffixContentTemplate property.
public static readonly BindableProperty EndAffixContentTemplateProperty
IsMoreButtonVisibleProperty
BindableProperty
Identifies the IsMoreButtonVisible property.
public static readonly BindableProperty IsMoreButtonVisibleProperty
IsSpeechToTextButtonVisibleProperty
BindableProperty
Identifies the IsSpeechToTextButtonVisible property.
public static readonly BindableProperty IsSpeechToTextButtonVisibleProperty
MaxInputLinesProperty
BindableProperty
Identifies the MaxInputLines property.
public static readonly BindableProperty MaxInputLinesProperty
MessageProperty
BindableProperty
Identifies the Message property.
public static readonly BindableProperty MessageProperty
MoreButtonActionItemViewStyleProperty
BindableProperty
Identifies the MoreButtonActionItemViewStyle property.
public static readonly BindableProperty MoreButtonActionItemViewStyleProperty
MoreButtonActionsProperty
BindableProperty
Identifies the MoreButtonActions property.
public static readonly BindableProperty MoreButtonActionsProperty
MoreButtonStyleProperty
BindableProperty
Identifies the MoreButtonStyle property.
public static readonly BindableProperty MoreButtonStyleProperty
PickFileCommandProperty
BindableProperty
Identifies the PickFileCommand property.
public static readonly BindableProperty PickFileCommandProperty
PickFileTypesProperty
BindableProperty
Identifies the PickFileTypes property.
public static readonly BindableProperty PickFileTypesProperty
PickPhotoCommandProperty
BindableProperty
Identifies the PickPhotoCommand property.
public static readonly BindableProperty PickPhotoCommandProperty
PlaceholderColorProperty
BindableProperty
Identifies the PlaceholderColor property.
public static readonly BindableProperty PlaceholderColorProperty
PlaceholderProperty
BindableProperty
Identifies the Placeholder property.
public static readonly BindableProperty PlaceholderProperty
RemoveAttachedFileCommandProperty
BindableProperty
Identifies the RemoveAttachedFileCommand property.
public static readonly BindableProperty RemoveAttachedFileCommandProperty
SendButtonStyleProperty
BindableProperty
Identifies the SendButtonStyle property.
public static readonly BindableProperty SendButtonStyleProperty
SendMessageButtonImageProperty
BindableProperty
Identifies the SendMessageButtonImage property.
public static readonly BindableProperty SendMessageButtonImageProperty
SendMessageCommandProperty
BindableProperty
Identifies the SendMessageCommand property.
public static readonly BindableProperty SendMessageCommandProperty
SpeechToTextButtonStyleProperty
BindableProperty
Identifies the SpeechToTextButtonStyle property.
public static readonly BindableProperty SpeechToTextButtonStyleProperty
StartAffixContentTemplateProperty
BindableProperty
Identifies the StartAffixContentTemplate property.
public static readonly BindableProperty StartAffixContentTemplateProperty
TakePhotoCommandProperty
BindableProperty
Identifies the TakePhotoCommand property.
public static readonly BindableProperty TakePhotoCommandProperty
TextColorProperty
BindableProperty
Identifies the TextColor property.
public static readonly BindableProperty TextColorProperty
TopAffixContentTemplateProperty
BindableProperty
Identifies the TopAffixContentTemplate property.
public static readonly BindableProperty TopAffixContentTemplateProperty
Properties
Gets the actual command that is executed when removing an attached file. This command will execute the custom RemoveAttachedFileCommand.
public ICommand ActualRemoveAttachedFileCommand { get; }
Gets or sets a collection that contains the currently attached files that have not yet been sent.
public ICollection<PromptInputAttachedFile> AttachedFiles { get; set; }
Gets or sets a value indicating whether to automatically generate default actions for the 'More' button.
public bool AutoGenerateMoreButtonActions { get; set; }
Gets or sets the display mode for the PromptInput control. The default value is Automatic.
public PromptInputDisplayMode DisplayMode { get; set; }
EndAffixContentTemplate
DataTemplate
Gets or sets the end affix content template for the input area. The end affix content is displayed in the right side at the bottom of the prompt input area, before the default content i.e. the 'Speech-to-text' and 'Send' buttons.
public DataTemplate EndAffixContentTemplate { get; set; }
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.
public bool IsMoreButtonVisible { get; set; }
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.
public bool IsSpeechToTextButtonVisible { get; set; }
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.
public int MaxInputLines { get; set; }
Gets or sets the message that is typed in the input area.
public object Message { get; set; }
Gets or sets a custom style that is to be applied to the action item views in the 'More' button dropdown. The actual style that is applied is a merger between this style and the default style. The target type of this style is RadTemplatedButton.
public Style MoreButtonActionItemViewStyle { get; set; }
Gets or sets the collection of toolbar actions displayed in the input area more button.
public IList<PromptInputButtonAction> MoreButtonActions { get; set; }
MoreButtonStyle
Style
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 RadDropDownButton. The target type of this style is RadDropDownButton.
public Style MoreButtonStyle { get; set; }
Gets or sets the command that opens the for attaching files for upload.
public ICommand PickFileCommand { get; set; }
PickFileTypes
FilePickerFileType
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).
public FilePickerFileType PickFileTypes { get; set; }
Gets or sets the command that opens the for attaching photos for upload.
public ICommand PickPhotoCommand { get; set; }
Gets or sets the placeholder text displayed in the input area when it is empty.
public string Placeholder { get; set; }
PlaceholderColor
Color
Gets or sets the placeholder color of the input area.
public Color PlaceholderColor { get; set; }
Gets or sets the command that will be executed when removing an attached file from the RadPromptInput.
public ICommand RemoveAttachedFileCommand { get; set; }
SendButtonStyle
Style
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.
public Style SendButtonStyle { get; set; }
SendMessageButtonImage
ImageSource
Gets or sets the image for the send message button.
public ImageSource SendMessageButtonImage { get; set; }
Gets the command that is executed when speech is recognized by the speech-to-text button.
public ICommand SpeechRecognizedCommand { get; }
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.
public Style SpeechToTextButtonStyle { get; set; }
StartAffixContentTemplate
DataTemplate
Gets or sets the start affix content template for the input area. The start affix content is displayed in the left side at the bottom of the prompt input area, after the default content i.e. the 'More' button.
public DataTemplate StartAffixContentTemplate { get; set; }
Gets or sets the command that opens the camera for attaching a photo.
public ICommand TakePhotoCommand { get; set; }
TextColor
Color
Gets or sets the text color of the input area.
public Color TextColor { get; set; }
TopAffixContentTemplate
DataTemplate
Gets or sets the top affix content template for the input area. The top affix content is displayed above the text input area and below the attached files view.
public DataTemplate TopAffixContentTemplate { get; set; }
Methods
protected override void OnApplyTemplate()
Overrides:
Unsets keyboard focus on this element.
public void Unfocus()