Class BlockEditorContextMenu
Gets or sets the settings for the context menu within the editor.
Inherited Members
Namespace: Syncfusion.Blazor.BlockEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class BlockEditorContextMenu : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
This menu allows quick access to contextual actions related to selected blocks or text.
Constructors
BlockEditorContextMenu()
Declaration
public BlockEditorContextMenu()
Properties
Closing
Triggers when the context menu is being closed.
Declaration
[Parameter]
public EventCallback<ContextMenuClosingEventArgs> Closing { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<ContextMenuClosingEventArgs> | An event callback that provides the ContextMenuClosingEventArgs. |
Remarks
This is triggered when the menu is dismissed either by selecting an action or clicking outside.
Enable
Specifies whether the context menu is enabled.
Declaration
[Parameter]
public bool Enable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | A boolean value that indicates whether the context menu menu is enabled. The default value is |
Remarks
If set to false, the context menu will not be displayed.
ItemSelect
Triggers when an menu item is selected from the context menu.
Declaration
[Parameter]
public EventCallback<ContextMenuItemSelectEventArgs> ItemSelect { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<ContextMenuItemSelectEventArgs> | An event callback that provides the ContextMenuItemSelectEventArgs. |
Remarks
This event helps to identify which menu item was selected and apply the corresponding logic.
Examples
private void OnItemSelect(ContextMenuItemSelectEventArgs args)
{
Console.WriteLine($""Action selected: {args.Item}"");
}
Items
Gets or sets the list of context menu items.
Declaration
[Parameter]
public List<ContextMenuItemModel> Items { get; set; }
Property Value
| Type |
|---|
| List<ContextMenuItemModel> |
Opening
Triggers when the context menu is being opened.
Declaration
[Parameter]
public EventCallback<ContextMenuOpeningEventArgs> Opening { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback<ContextMenuOpeningEventArgs> | An event callback that provides the ContextMenuOpeningEventArgs. |
Remarks
You can use this event to perform additional logic such as disabling a particular menu item for a particular block while the context menu becomes visible.
ShowItemOnClick
Specifies whether menu items should only be shown when clicked.
Declaration
[Parameter]
public bool ShowItemOnClick { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | A boolean value that indicates whether menu items should only be shown when clicked. The default value is |
Remarks
If set to true, submenu items appear only when the parent item is clicked.
Methods
Dispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Overrides
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
| Type |
|---|
| Task |