Table of Contents

Class RadzenHtmlEditorCustomTool

Namespace
Radzen.Blazor
Assembly
Radzen.Blazor.dll

A custom tool in RadzenHtmlEditor

public class RadzenHtmlEditorCustomTool : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender
Inheritance
RadzenHtmlEditorCustomTool
Implements
Inherited Members

Examples

<RadzenHtmlEditor Execute=@OnExecute>
  <RadzenHtmlEditorCustomTool CommandName="InsertToday" Icon="today" Title="Insert today" />
</RadzenHtmlEditor>
@code {
  string html = "@lt;strong>Hello</strong> world!"; 
  async Task OnExecute(HtmlEditorExecuteEventArgs args)
  {
    if (args.CommandName == "InsertToday")
    {
      await args.Editor.ExecuteCommandAsync(HtmlEditorCommands.InsertHtml, DateTime.Today.ToLongDateString());
    }
 }

Constructors

RadzenHtmlEditorCustomTool()

public RadzenHtmlEditorCustomTool()

Properties

CommandName

[Parameter]
public string CommandName { get; set; }

Property Value

string

Disabled

Specifies whether the tool is disabled.

[Parameter]
public bool Disabled { get; set; }

Property Value

bool

Editor

The RadzenHtmlEditor component which this tool is part of.

[CascadingParameter]
public RadzenHtmlEditor Editor { get; set; }

Property Value

RadzenHtmlEditor

EnabledModes

Specifies the modes that this tool will be enabled in.

[Parameter]
public HtmlEditorMode EnabledModes { get; set; }

Property Value

HtmlEditorMode

Icon

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

[Parameter]
public string Icon { get; set; }

Property Value

string

IconColor

Gets or sets the icon color.

[Parameter]
public string IconColor { get; set; }

Property Value

string

The icon color.

Selected

Specifies whether the tool is selected.

[Parameter]
public bool Selected { get; set; }

Property Value

bool

Template

The template of the tool. Use to render a custom tool.

[Parameter]
public RenderFragment<RadzenHtmlEditor> Template { get; set; }

Property Value

RenderFragment<RadzenHtmlEditor>

Title

Specifies the title (tooltip) displayed when the user hovers the tool.

[Parameter]
public string Title { get; set; }

Property Value

string

Visible

Determines if the tools is visible.

[Parameter]
public bool Visible { get; set; }

Property Value

bool

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder