mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-02-04 05:35:44 +00:00
49 lines
1.4 KiB
C#
49 lines
1.4 KiB
C#
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace Radzen.Blazor
|
|
{
|
|
/// <summary>
|
|
/// A tool which changes the font size of the selected text.
|
|
/// </summary>
|
|
/// <example>
|
|
/// <code>
|
|
/// <RadzenHtmlEditor @bind-Value=@html>
|
|
/// <RadzenHtmlEditorFontSize />
|
|
/// </RadzenHtmlEdito>
|
|
/// @code {
|
|
/// string html = "@lt;strong>Hello</strong> world!";
|
|
/// }
|
|
/// </code>
|
|
/// </example>
|
|
public partial class RadzenHtmlEditorFontSize
|
|
{
|
|
/// <summary>
|
|
/// The RadzenHtmlEditor component which this tool is part of.
|
|
/// </summary>
|
|
[CascadingParameter]
|
|
public RadzenHtmlEditor? Editor { get; set; }
|
|
|
|
/// <summary>
|
|
/// Specifies the placeholder displayed to the user. Set to <c>"Font size"</c> by default.
|
|
/// </summary>
|
|
[Parameter]
|
|
public string Placeholder { get; set; } = "Font size";
|
|
|
|
/// <summary>
|
|
/// Specifies the title (tooltip) displayed when the user hovers the tool. Set to <c>"Font size"</c> by default.
|
|
/// </summary>
|
|
[Parameter]
|
|
public string Title { get; set; } = "Font size";
|
|
|
|
async Task OnChange(string value)
|
|
{
|
|
if (Editor != null)
|
|
{
|
|
await Editor.ExecuteCommandAsync("fontSize", value);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|