Displays an AI response's title and text with copy, regenerate, and vote actions.
Definition
Namespace:Telerik.WinControls.UI.ConversationalUI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class AIChatMainMessageElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementAIChatMainMessageElement...
Implements:
Inherited Members
Constructors
Initializes the main response element with the visual item that receives its action callbacks.
public AIChatMainMessageElement(AIChatMessageItemElement visualItem)
The AI message item element that handles copy, regeneration, and vote actions.
Properties
Gets the container that hosts the response action buttons.
protected virtual AIPromptButtonsContainer ButtonsContainer { get; }
Gets the button that copies the response text.
public LightVisualButtonElement CopyButtonElement { get; }
Gets the toggle button that represents the down-vote state.
public AIPromptToggleButtonElement DislikeButtonElement { get; }
Gets the toggle button that represents the up-vote state.
public AIPromptToggleButtonElement LikeButtonElement { get; }
Gets the stack that hosts the title, response text, and action row.
protected virtual StackLayoutElementLite MainStack { get; }
Gets the button that requests response regeneration.
public LightVisualButtonElement RetryButtonElement { get; }
Gets whether the response action container is visible.
public bool ShowButtonsArea { get; }
Gets the element bound to the response text.
public LightVisualElement TextElement { get; }
Gets the title element shown above the response.
public LightVisualElement TitleElement { get; }
Methods
Creates the container that places copy and regenerate actions on the left and vote actions on the right.
protected virtual AIPromptButtonsContainer CreateButtonsContainer()
The response action container.
Creates the title, wrapped response text, and action buttons, then binds the text element to this element's text.
protected override void CreateChildElements()
Overrides:
Creates the button that copies the response text through the owning chat element.
protected virtual AIPromptButtonElement CreateCopyButtonElement()
The copy button.
Creates the toggle button used to submit a down-vote.
protected virtual AIPromptToggleButtonElement CreateDislikeButtonElement()
The down-vote toggle button.
Creates the toggle button used to submit an up-vote.
protected virtual AIPromptToggleButtonElement CreateLikeButtonElement()
The up-vote toggle button.
Creates the vertical stack that contains the title, response text, and action row.
protected virtual StackLayoutElementLite CreateMainStack()
The root stack for the AI response card.
Creates the button that requests regeneration of the response.
protected virtual AIPromptButtonElement CreateRetryButtonElement()
The regenerate button.
Creates the element bound to the generated response text.
protected virtual LightVisualElement CreateTextElement()
The response text element.
Creates the title element shown above the generated response.
protected virtual AIChatTitleElement CreateTitleElement()
The title element.
Configures the rounded response-card shape, padding, and transparent background.
protected override void InitializeFields()
Overrides:
Updates the vote buttons and forwards the selected vote to the AI message item.
protected virtual void OnUserVotedChanged(VoteType vote)
The new vote state.