Class ResponseActions
Represents the response settings configuration for the SfInlineAIAssist component, providing options to customize the response popup behavior and handle response action item selection.
Inherited Members
Namespace: Syncfusion.Blazor.InteractiveChat
Assembly: Syncfusion.Blazor.InteractiveChat.dll
Syntax
public class ResponseActions : OwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
Use this class to configure response-related settings within the SfInlineAIAssist component.
Examples
The following example demonstrates how to declare and configure ResponseActions inside a SfInlineAIAssist component.
<SfInlineAIAssist>
<ResponseActions Items="@responseItems" ItemSelect = "@HandleResponseItemSelect">
</ResponseActions>
</SfInlineAIAssist>
@code {
private List<ResponseItem> responseItems = new List<ResponseItem>()
{
new ResponseItem
{
IconCss = "e-icons",
Label = "Apply",
Tooltip = "Apply changes",
Disabled = false,
ID = "applyCommand"
}
};
private Task HandleResponseItemSelect(ResponseItemSelectEventArgs args)
{
if (args.Item.Label == "Apply")
{
Console.WriteLine("Apply action selected");
}
else if (args.Item.Label == "Cancel")
{
args.Cancel = true;
}
return Task.CompletedTask;
}
}
Constructors
ResponseActions()
Declaration
public ResponseActions()
Properties
ItemSelect
Gets or sets the callback that is invoked when a response item is selected.
Declaration
[Parameter]
public EventCallback<ResponseItemSelectEventArgs> ItemSelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<ResponseItemSelectEventArgs> | An EventCallback<TValue> of type ResponseItemSelectEventArgs that handles the item selection event. The default value is an empty callback (no handler is assigned). |
Items
Gets or sets the collection of ResponseItem instances configured within the ResponseActions of the SfInlineAIAssist component.
Declaration
[Parameter]
public List<ResponseItem> Items { get; set; }
Property Value
| Type | Description |
|---|---|
| List<ResponseItem> | A List<T> of ResponseItem representing the response action items displayed in the response popup. The default value is an empty collection. |
Remarks
Use this property to define and configure the list of ResponseItem instances that appear in the response popup of the SfInlineAIAssist component after an AI response is generated.
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
Dispose(bool)
Dispose unmanaged resources in the Syncfusion Blazor component.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Boolean value to dispose the object. |
Overrides
OnInitializedAsync()
Method invoked when the component is ready to start.
Declaration
protected override Task OnInitializedAsync()
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing any asynchronous operation. |
Overrides
OnParametersSetAsync()
Handles parameter updates for the InlineToolbar component.
Declaration
protected override Task OnParametersSetAsync()
Returns
| Type | Description |
|---|---|
| Task | A System.Threading.Tasks.Task representing any asynchronous operation. |