Class CommandMenu
Represents the command menu configuration for the SfInlineAIAssist component, providing options to customize the command popup behavior and handle command item selection.
Inherited Members
Namespace: Syncfusion.Blazor.InteractiveChat
Assembly: Syncfusion.Blazor.InteractiveChat.dll
Syntax
public class CommandMenu : OwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
Use this class to configure command menu related settings within the SfInlineAIAssist component.
Examples
The following example demonstrates how to declare and configure an CommandMenu inside the SfInlineAIAssist component.
<SfInlineAIAssist>
<CommandMenu Commands="@commandItems" PopupWidth = "300px" PopupHeight = "auto" ItemSelect = "@HandleCommandItemSelect">
</CommandMenu>
</SfInlineAIAssist>
@code {
private List<CommandItem> commandItems = new List<CommandItem>()
{
new CommandItem
{
IconCss = "e-icons",
Label = "Copy",
Prompt = "Copy the selected content",
Tooltip = "Copy text",
Disabled = false,
GroupBy = "Clipboard",
ID = "copyCommand"
}
};
private void HandleCommandItemSelect(CommandItemSelectEventArgs args)
{
if (args.Command.ID == "restrictedCommand")
{
args.Cancel = true;
}
}
}
Constructors
CommandMenu()
Declaration
public CommandMenu()
Properties
Commands
Gets or sets the collection of CommandItem instances configured within the CommandMenu of the SfInlineAIAssist component.
Declaration
[Parameter]
public List<CommandItem> Commands { get; set; }
Property Value
| Type | Description |
|---|---|
| List<CommandItem> | A List<T> of CommandItem representing the command items displayed in the command popup. The default value is an empty collection. |
Remarks
Use this property to define and configure the list of CommandItem instances that appear in the command popup of the SfInlineAIAssist component.
ItemSelect
Gets or sets the callback that is invoked when a command item is selected.
Declaration
[Parameter]
public EventCallback<CommandItemSelectEventArgs> ItemSelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<CommandItemSelectEventArgs> | An EventCallback<TValue> of type CommandItemSelectEventArgs that handles the item selection event. The default value is an empty callback (no handler is assigned). |
PopupHeight
Gets or sets the height of the command popup in the SfInlineAIAssist component.
Declaration
[Parameter]
public string PopupHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the height of the command popup. The default value is |
Remarks
Accepts any valid CSS height value, including pixel units (e.g., "200px"), percentage values (e.g., "50%"),
or other CSS length units such as "10rem".
PopupWidth
Gets or sets the width of the command popup in the SfInlineAIAssist component.
Declaration
[Parameter]
public string PopupWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the width of the command popup. The default value is |
Remarks
Accepts any valid CSS width value, including pixel units (e.g., "300px"), percentage values (e.g., "50%"),
or other CSS length units such as "20rem".
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. |