A custom tool in RadzenHtmlEditor
Object
ComponentBase
IComponent
IHandleEvent
IHandleAfterRender
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
public class RadzenHtmlEditorCustomTool : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender<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());
}
}A custom tool in RadzenHtmlEditor
public RadzenHtmlEditorCustomTool()public string CommandName { get; set; }
| Type | Description |
|---|---|
| string |
Specifies whether the tool is disabled.
public bool Disabled { get; set; }
| Type | Description |
|---|---|
| bool | Specifies whether the tool is disabled. |
The RadzenHtmlEditor component which this tool is part of.
public RadzenHtmlEditor Editor { get; set; }
| Type | Description |
|---|---|
| RadzenHtmlEditor | The RadzenHtmlEditor component which this tool is part of. |
Specifies the modes that this tool will be enabled in.
public HtmlEditorMode EnabledModes { get; set; }
| Type | Description |
|---|---|
| HtmlEditorMode | Specifies the modes that this tool will be enabled in. |
Specifies the icon of the tool. Set to "settings" by default.
public string Icon { get; set; }
| Type | Description |
|---|---|
| string | Specifies the icon of the tool. Set to "settings" by default. |
Gets or sets the icon color.
public string IconColor { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the icon color. |
Specifies whether the tool is selected.
public bool Selected { get; set; }
| Type | Description |
|---|---|
| bool | Specifies whether the tool is selected. |
The template of the tool. Use to render a custom tool.
public RenderFragment<RadzenHtmlEditor> Template { get; set; }
| Type | Description |
|---|---|
| RenderFragment<RadzenHtmlEditor> | The template of the tool. Use to render a custom tool. |
Specifies the title (tooltip) displayed when the user hovers the tool.
public string Title { get; set; }
| Type | Description |
|---|---|
| string | Specifies the title (tooltip) displayed when the user hovers the tool. |
Determines if the tools is visible.
public bool Visible { get; set; }
| Type | Description |
|---|---|
| bool | Determines if the tools is visible. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |