RadzenMarkdownEditorCustomTool Class

A custom tool in RadzenMarkdownEditor. Either renders a button which raises Execute with CommandName, or arbitrary content via Template.

Inheritance

Object

ComponentBase

RadzenMarkdownEditorCustomTool

Implements

IComponent

IHandleEvent

IHandleAfterRender

Inherited Members

ComponentBase.OnInitialized

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.OnAfterRenderAsync

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.SetParametersAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenMarkdownEditorCustomTool : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender

Examples

<RadzenMarkdownEditor @bind-Value=@markdown Execute=@OnExecute>
  <RadzenMarkdownEditorCustomTool CommandName="InsertToday" Icon="today" Title="Insert today" />
</RadzenMarkdownEditor>
@code {
  async Task OnExecute(MarkdownEditorExecuteEventArgs args)
  {
    if (args.CommandName == "InsertToday")
    {
      await args.Editor.ExecuteCommandAsync(MarkdownEditorCommands.InsertText, DateTime.Today.ToLongDateString());
    }
  }
}

Constructors

RadzenMarkdownEditorCustomToolLink to this section

A custom tool in RadzenMarkdownEditor. Either renders a button which raises Execute with CommandName, or arbitrary content via Template.

Declaration
public RadzenMarkdownEditorCustomTool()

Properties

CommandNameLink to this section

The command name passed to Execute when the tool is clicked.

Declaration
public string CommandName { get; set; }
Property Value
Type Description
stringThe command name passed to Execute when the tool is clicked.

DisabledLink to this section

Specifies whether the tool is disabled.

Declaration
public bool Disabled { get; set; }
Property Value
Type Description
boolSpecifies whether the tool is disabled.

EditorLink to this section

The editor this tool belongs to.

Declaration
public RadzenMarkdownEditor Editor { get; set; }
Property Value
Type Description
RadzenMarkdownEditorThe editor this tool belongs to.

IconLink to this section

The icon of the tool. Set to "settings" by default.

Declaration
public string Icon { get; set; }
Property Value
Type Description
stringThe icon of the tool. Set to "settings" by default.

IconColorLink to this section

The icon color.

Declaration
public string IconColor { get; set; }
Property Value
Type Description
stringThe icon color.

SelectedLink to this section

Specifies whether the tool is rendered as selected.

Declaration
public bool Selected { get; set; }
Property Value
Type Description
boolSpecifies whether the tool is rendered as selected.

TemplateLink to this section

Custom content rendered instead of the button. Receives the editor.

Declaration
public RenderFragment<RadzenMarkdownEditor> Template { get; set; }
Property Value
Type Description
RenderFragment<RadzenMarkdownEditor>Custom content rendered instead of the button. Receives the editor.

TitleLink to this section

The tooltip of the tool.

Declaration
public string Title { get; set; }
Property Value
Type Description
stringThe tooltip of the tool.

VisibleLink to this section

Determines if the tool is visible.

Declaration
public bool Visible { get; set; }
Property Value
Type Description
boolDetermines if the tool is visible.

Methods

BuildRenderTreeLink to this section

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder
An error has occurred. This app may no longer respond until reloaded. Reload 🗙