New to Telerik UI for .NET MAUIStart a free 30-day trial

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

Constructors

Initializes a new instance of the RadPromptInput class.

C#
public RadPromptInput()

Fields

Identifies the ActualRemoveAttachedFileCommand property.

C#
public static readonly BindableProperty ActualRemoveAttachedFileCommandProperty

AttachedFilesProperty

BindableProperty

Identifies the AttachedFiles property.

C#
public static readonly BindableProperty AttachedFilesProperty

Identifies the AutoGenerateMoreButtonActions property.

C#
public static readonly BindableProperty AutoGenerateMoreButtonActionsProperty

DisplayModeProperty

BindableProperty

Identifies the DisplayMode property.

C#
public static readonly BindableProperty DisplayModeProperty

Identifies the EndAffixContentTemplate property.

C#
public static readonly BindableProperty EndAffixContentTemplateProperty

Identifies the IsMoreButtonVisible property.

C#
public static readonly BindableProperty IsMoreButtonVisibleProperty

Identifies the IsSpeechToTextButtonVisible property.

C#
public static readonly BindableProperty IsSpeechToTextButtonVisibleProperty

MaxInputLinesProperty

BindableProperty

Identifies the MaxInputLines property.

C#
public static readonly BindableProperty MaxInputLinesProperty

MessageProperty

BindableProperty

Identifies the Message property.

C#
public static readonly BindableProperty MessageProperty

Identifies the MoreButtonActionItemViewStyle property.

C#
public static readonly BindableProperty MoreButtonActionItemViewStyleProperty

Identifies the MoreButtonActions property.

C#
public static readonly BindableProperty MoreButtonActionsProperty

MoreButtonStyleProperty

BindableProperty

Identifies the MoreButtonStyle property.

C#
public static readonly BindableProperty MoreButtonStyleProperty

PickFileCommandProperty

BindableProperty

Identifies the PickFileCommand property.

C#
public static readonly BindableProperty PickFileCommandProperty

PickFileTypesProperty

BindableProperty

Identifies the PickFileTypes property.

C#
public static readonly BindableProperty PickFileTypesProperty

PickPhotoCommandProperty

BindableProperty

Identifies the PickPhotoCommand property.

C#
public static readonly BindableProperty PickPhotoCommandProperty

PlaceholderColorProperty

BindableProperty

Identifies the PlaceholderColor property.

C#
public static readonly BindableProperty PlaceholderColorProperty

PlaceholderProperty

BindableProperty

Identifies the Placeholder property.

C#
public static readonly BindableProperty PlaceholderProperty

Identifies the RemoveAttachedFileCommand property.

C#
public static readonly BindableProperty RemoveAttachedFileCommandProperty

SendButtonStyleProperty

BindableProperty

Identifies the SendButtonStyle property.

C#
public static readonly BindableProperty SendButtonStyleProperty

Identifies the SendMessageButtonImage property.

C#
public static readonly BindableProperty SendMessageButtonImageProperty

Identifies the SendMessageCommand property.

C#
public static readonly BindableProperty SendMessageCommandProperty

Identifies the SpeechToTextButtonStyle property.

C#
public static readonly BindableProperty SpeechToTextButtonStyleProperty

Identifies the StartAffixContentTemplate property.

C#
public static readonly BindableProperty StartAffixContentTemplateProperty

TakePhotoCommandProperty

BindableProperty

Identifies the TakePhotoCommand property.

C#
public static readonly BindableProperty TakePhotoCommandProperty

TextColorProperty

BindableProperty

Identifies the TextColor property.

C#
public static readonly BindableProperty TextColorProperty

Identifies the TopAffixContentTemplate property.

C#
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.

C#
public ICommand ActualRemoveAttachedFileCommand { get; }

Gets or sets a collection that contains the currently attached files that have not yet been sent.

C#
public ICollection<PromptInputAttachedFile> AttachedFiles { get; set; }

Gets or sets a value indicating whether to automatically generate default actions for the 'More' button.

C#
public bool AutoGenerateMoreButtonActions { get; set; }

Gets or sets the display mode for the PromptInput control. The default value is Automatic.

C#
public PromptInputDisplayMode DisplayMode { get; set; }

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.

C#
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.

C#
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.

C#
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.

C#
public int MaxInputLines { get; set; }

Gets or sets the message that is typed in the input area.

C#
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.

C#
public Style MoreButtonActionItemViewStyle { get; set; }

Gets or sets the collection of toolbar actions displayed in the input area more button.

C#
public IList<PromptInputButtonAction> MoreButtonActions { get; set; }

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.

C#
public Style MoreButtonStyle { get; set; }

Gets or sets the command that opens the for attaching files for upload.

C#
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).

C#
public FilePickerFileType PickFileTypes { get; set; }

Gets or sets the command that opens the for attaching photos for upload.

C#
public ICommand PickPhotoCommand { get; set; }

Gets or sets the placeholder text displayed in the input area when it is empty.

C#
public string Placeholder { get; set; }

Gets or sets the placeholder color of the input area.

C#
public Color PlaceholderColor { get; set; }

Gets or sets the command that will be executed when removing an attached file from the RadPromptInput.

C#
public ICommand RemoveAttachedFileCommand { get; set; }

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.

C#
public Style SendButtonStyle { get; set; }

Gets or sets the image for the send message button.

C#
public ImageSource SendMessageButtonImage { get; set; }

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.

C#
public ICommand SendMessageCommand { get; set; }

Gets the command that is executed when speech is recognized by the speech-to-text button.

C#
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.

C#
public Style SpeechToTextButtonStyle { get; set; }

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.

C#
public DataTemplate StartAffixContentTemplate { get; set; }

Gets or sets the command that opens the camera for attaching a photo.

C#
public ICommand TakePhotoCommand { get; set; }

Gets or sets the text color of the input area.

C#
public Color TextColor { get; set; }

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.

C#
public DataTemplate TopAffixContentTemplate { get; set; }

Methods

Attempts to set focus to this element.

C#
public bool Focus()
Returns:

bool

C#
protected override void OnApplyTemplate()

Overrides: RadCompositeContentView.OnApplyTemplate()

Unsets keyboard focus on this element.

C#
public void Unfocus()