Represents the buttons panel area of the RadPromptInputElement. Manages the send, clear, speech-to-text, prompt suggestions, and more buttons, along with the suggestion and more-button context menus.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class PromptInputButtonsPanelElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementPromptInputButtonsPanelElement...
Implements:
Inherited Members
Constructors
Initializes a new instance of the PromptInputButtonsPanelElement class.
public PromptInputButtonsPanelElement()
Properties
Gets the dock layout panel that hosts the left and right button panels.
[Browsable(false)]
public DockLayoutPanel ButtonsPanel { get; }
Gets the clear button element.
[Browsable(false)]
public LightVisualButtonElement ClearButton { get; }
Gets or sets the text displayed inside the prompt-suggestions popup
when both SuggestedPrompts and RecentPrompts
are empty. When set to a non-empty value the popup will open with a single
disabled menu item carrying this text. When null or empty
(default), the popup does not open at all when there are no suggestions.
public string EmptyPromptSuggestionsText { get; set; }
Gets the left buttons panel (suggestions, more).
[Browsable(false)]
public StackLayoutElementLite LeftButtonsPanel { get; }
Gets the more button element.
[Browsable(false)]
public LightVisualButtonElement MoreButton { get; }
Gets or sets the collection of action items displayed in the more button popup.
[Browsable(false)]
public IList<PromptInputButtonAction> MoreButtonActions { get; set; }
Gets the prompt suggestions button element.
[Browsable(false)]
public LightVisualButtonElement PromptSuggestionsButton { get; }
RecentPrompts
IList<string>
Gets or sets the collection of recent prompts.
[Browsable(false)]
public IList<string> RecentPrompts { get; set; }
Gets the right buttons panel (clear, STT, send).
[Browsable(false)]
public StackLayoutElementLite RightButtonsPanel { get; }
Gets the send button element.
[Browsable(false)]
public ChatSendButtonElement SendButton { get; }
Gets or sets a value indicating whether the clear button is visible.
public bool ShowClearButton { get; set; }
Gets or sets a value indicating whether the more button is visible.
public bool ShowMoreButton { get; set; }
Gets or sets a value indicating whether the prompt suggestions button is visible.
public bool ShowPromptSuggestionsButton { get; set; }
Gets or sets a value indicating whether the recent prompts section is visible in the popup.
public bool ShowRecentPrompts { get; set; }
Gets or sets a value indicating whether the speech-to-text button is visible.
public bool ShowSpeechToTextButton { get; set; }
Gets or sets a value indicating whether the suggested prompts section is visible in the popup.
public bool ShowSuggestedPrompts { get; set; }
Gets the speech-to-text button element.
[Browsable(false)]
public RadSpeechToTextButtonElement SpeechToTextButton { get; }
SuggestedPrompts
IList<string>
Gets or sets the collection of suggested prompts.
[Browsable(false)]
public IList<string> SuggestedPrompts { get; set; }
Methods
Creates the dock layout panel for buttons. Override to customize.
Called by the element when constructed. Allows inheritors to build the element tree.
protected override void CreateChildElements()
Overrides:
Creates the clear button element. Override to customize.
Creates the left buttons panel. Override to customize.
protected virtual StackLayoutElementLite CreateLeftButtonsPanel()
Creates the more button. Override to customize.
Creates the more button context menu dropdown. Override to customize.
protected virtual RadContextMenuDropDown CreateMoreButtonContextMenu()
Creates the prompt suggestions button. Override to customize.
protected virtual PromptInputSuggestionsButton CreatePromptSuggestionsButton()
Creates the right buttons panel. Override to customize.
protected virtual StackLayoutElementLite CreateRightButtonsPanel()
Creates the send button element. Override to customize.
Creates the speech-to-text button element. Override to customize.
protected virtual RadSpeechToTextButtonElement CreateSpeechToTextButton()
Creates the suggestions context menu dropdown. Override to customize.
protected virtual RadContextMenuDropDown CreateSuggestionsContextMenu()
Disposes of managed resources including cached images and SVG images when the element is being disposed.
protected override void DisposeManagedResources()
Overrides:
Initializes the internal fields and components of the LightVisualElement. This method sets up text primitives, image primitives, and layout management components.
protected override void InitializeFields()
Overrides:
Raises the CancelClicked event.
Raises the ClearClicked event.
Handles property change events by invalidating the fill cache and invoking the base class property change handler.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Event arguments containing information about the property that changed.
Overrides:
Raises the SendClicked event.
Raises the SuggestionSelected event.
protected virtual void OnSuggestionSelected(PromptInputSuggestionSelectedEventArgs args)
Raises the SuggestionSelecting event.
protected virtual void OnSuggestionSelecting(PromptInputSuggestionSelectingEventArgs args)
Updates the clear button visibility based on the current text state. Called by the parent element when text changes.
public void UpdateClearButtonVisibility(bool hasText)
Whether the input box contains text.
Updates the send button enabled state and icon based on the current state. Called by the parent element when text, files, or processing state changes.
Events
Occurs when the user clicks the send button while in a processing state.
public event EventHandler CancelClicked
Occurs when the clear button is clicked.
public event EventHandler ClearClicked
Occurs when the user clicks the send button while not in a processing state.
public event EventHandler SendClicked
Occurs when the user selects a suggestion from the prompt suggestions dropdown.
public event PromptInputSuggestionSelectedEventHandler SuggestionSelected
Occurs before a suggestion is applied. Set Cancel to true to prevent applying.
public event PromptInputSuggestionSelectingEventHandler SuggestionSelecting