Class
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:

cs-api-definition
public class RadPromptInput : RadBorderContentView, IRadContentView, IContentView, IView, IElement, ITransform, IPadding, ICrossPlatformLayout

Inheritance: objectRadContentViewRadCompositeContentViewRadBorderContentViewRadPromptInput

Implements: IContentViewICrossPlatformLayoutIElementIPaddingIRadContentViewITransformIView

Inherited Members RadBorderContentView.BackgroundColorPropertyRadBorderContentView.BackgroundPropertyRadBorderContentView.BorderColorPropertyRadBorderContentView.BorderBrushPropertyRadBorderContentView.BorderThicknessPropertyRadBorderContentView.CornerRadiusPropertyRadBorderContentView.ContentPaddingPropertyRadBorderContentView.BackgroundColorRadBorderContentView.BackgroundRadBorderContentView.BorderColorRadBorderContentView.BorderBrushRadBorderContentView.BorderThicknessRadBorderContentView.CornerRadiusRadBorderContentView.ContentPaddingRadCompositeContentView.StylePropertyRadCompositeContentView.ControlTemplatePropertyRadCompositeContentView.OnBindingContextChanged()RadCompositeContentView.OnPropertyChanged(string)RadCompositeContentView.StyleRadCompositeContentView.ControlTemplateRadContentView.ActualStyleClassPropertyRadContentView.OnChildAdded(Element)RadContentView.OnChildRemoved(Element, int)RadContentView.OnHandlerChanged()

Constructors

RadPromptInput()

Initializes a new instance of the RadPromptInput class.

Declaration

cs-api-definition
public RadPromptInput()

Fields

ActualRemoveAttachedFileCommandProperty

Identifies the ActualRemoveAttachedFileCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty ActualRemoveAttachedFileCommandProperty

Field Value

BindableProperty

AttachedFilesProperty

Identifies the AttachedFiles property.

Declaration

cs-api-definition
public static readonly BindableProperty AttachedFilesProperty

Field Value

BindableProperty

AutoGenerateMoreButtonActionsProperty

Identifies the AutoGenerateMoreButtonActions property.

Declaration

cs-api-definition
public static readonly BindableProperty AutoGenerateMoreButtonActionsProperty

Field Value

BindableProperty

DisplayModeProperty

Identifies the DisplayMode property.

Declaration

cs-api-definition
public static readonly BindableProperty DisplayModeProperty

Field Value

BindableProperty

IsMoreButtonVisibleProperty

Identifies the IsMoreButtonVisible property.

Declaration

cs-api-definition
public static readonly BindableProperty IsMoreButtonVisibleProperty

Field Value

BindableProperty

IsSpeechToTextButtonVisibleProperty

Identifies the IsSpeechToTextButtonVisible property.

Declaration

cs-api-definition
public static readonly BindableProperty IsSpeechToTextButtonVisibleProperty

Field Value

BindableProperty

MaxInputLinesProperty

Identifies the MaxInputLines property.

Declaration

cs-api-definition
public static readonly BindableProperty MaxInputLinesProperty

Field Value

BindableProperty

MessageProperty

Identifies the Message property.

Declaration

cs-api-definition
public static readonly BindableProperty MessageProperty

Field Value

BindableProperty

MoreButtonActionsProperty

Identifies the MoreButtonActions property.

Declaration

cs-api-definition
public static readonly BindableProperty MoreButtonActionsProperty

Field Value

BindableProperty

MoreButtonStyleProperty

Identifies the MoreButtonStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty MoreButtonStyleProperty

Field Value

BindableProperty

PickFileCommandProperty

Identifies the PickFileCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty PickFileCommandProperty

Field Value

BindableProperty

PickFileTypesProperty

Identifies the PickFileTypes property.

Declaration

cs-api-definition
public static readonly BindableProperty PickFileTypesProperty

Field Value

BindableProperty

PickPhotoCommandProperty

Identifies the PickPhotoCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty PickPhotoCommandProperty

Field Value

BindableProperty

PlaceholderColorProperty

Identifies the PlaceholderColor property.

Declaration

cs-api-definition
public static readonly BindableProperty PlaceholderColorProperty

Field Value

BindableProperty

PlaceholderProperty

Identifies the Placeholder property.

Declaration

cs-api-definition
public static readonly BindableProperty PlaceholderProperty

Field Value

BindableProperty

RemoveAttachedFileCommandProperty

Identifies the RemoveAttachedFileCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty RemoveAttachedFileCommandProperty

Field Value

BindableProperty

SendButtonStyleProperty

Identifies the SendButtonStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty SendButtonStyleProperty

Field Value

BindableProperty

SendMessageButtonImageProperty

Identifies the SendMessageButtonImage property.

Declaration

cs-api-definition
public static readonly BindableProperty SendMessageButtonImageProperty

Field Value

BindableProperty

SendMessageCommandProperty

Identifies the SendMessageCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty SendMessageCommandProperty

Field Value

BindableProperty

SpeechToTextButtonStyleProperty

Identifies the SpeechToTextButtonStyle property.

Declaration

cs-api-definition
public static readonly BindableProperty SpeechToTextButtonStyleProperty

Field Value

BindableProperty

TakePhotoCommandProperty

Identifies the TakePhotoCommand property.

Declaration

cs-api-definition
public static readonly BindableProperty TakePhotoCommandProperty

Field Value

BindableProperty

TextColorProperty

Identifies the TextColor property.

Declaration

cs-api-definition
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

cs-api-definition
public ICommand ActualRemoveAttachedFileCommand { get; }

Property Value

ICommand

AttachedFiles

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

Declaration

cs-api-definition
public ICollection<PromptInputAttachedFile> AttachedFiles { get; set; }

Property Value

ICollection<PromptInputAttachedFile>

AutoGenerateMoreButtonActions

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

Declaration

cs-api-definition
public bool AutoGenerateMoreButtonActions { get; set; }

Property Value

bool

DisplayMode

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

Declaration

cs-api-definition
public PromptInputDisplayMode DisplayMode { get; set; }

Property Value

PromptInputDisplayMode

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.

Declaration

cs-api-definition
public bool IsMoreButtonVisible { get; set; }

Property Value

bool

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

cs-api-definition
public bool IsSpeechToTextButtonVisible { get; set; }

Property Value

bool

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.

Declaration

cs-api-definition
public int MaxInputLines { get; set; }

Property Value

int

Message

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

Declaration

cs-api-definition
public object Message { get; set; }

Property Value

object

MoreButtonActions

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

Declaration

cs-api-definition
public IList<PromptInputButtonAction> MoreButtonActions { get; set; }

Property Value

IList<PromptInputButtonAction>

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

cs-api-definition
public Style MoreButtonStyle { get; set; }

Property Value

Style

PickFileCommand

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

Declaration

cs-api-definition
public ICommand PickFileCommand { get; set; }

Property Value

ICommand

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

cs-api-definition
public FilePickerFileType PickFileTypes { get; set; }

Property Value

FilePickerFileType

PickPhotoCommand

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

Declaration

cs-api-definition
public ICommand PickPhotoCommand { get; set; }

Property Value

ICommand

Placeholder

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

Declaration

cs-api-definition
public string Placeholder { get; set; }

Property Value

string

PlaceholderColor

Gets or sets the placeholder color of the input area.

Declaration

cs-api-definition
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

cs-api-definition
public ICommand RemoveAttachedFileCommand { get; set; }

Property Value

ICommand

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

cs-api-definition
public Style SendButtonStyle { get; set; }

Property Value

Style

SendMessageButtonImage

Gets or sets the image for the send message button.

Declaration

cs-api-definition
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

cs-api-definition
public ICommand SendMessageCommand { get; set; }

Property Value

ICommand

SpeechRecognizedCommand

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

Declaration

cs-api-definition
public ICommand SpeechRecognizedCommand { get; }

Property Value

ICommand

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

cs-api-definition
public Style SpeechToTextButtonStyle { get; set; }

Property Value

Style

TakePhotoCommand

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

Declaration

cs-api-definition
public ICommand TakePhotoCommand { get; set; }

Property Value

ICommand

TextColor

Gets or sets the text color of the input area.

Declaration

cs-api-definition
public Color TextColor { get; set; }

Property Value

Color

Methods

Focus()

Attempts to set focus to this element.

Declaration

cs-api-definition
public bool Focus()

Returns

bool

OnApplyTemplate()

Declaration

cs-api-definition
protected override void OnApplyTemplate()

Overrides RadCompositeContentView.OnApplyTemplate()

Unfocus()

Unsets keyboard focus on this element.

Declaration

cs-api-definition
public void Unfocus()