menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RichTextEditorBackgroundColor - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class RichTextEditorBackgroundColor

    A class used for configuring the background color properties in the SfRichTextEditor component.

    Inheritance
    System.Object
    ColorItemBase
    RichTextEditorBackgroundColor
    Inherited Members
    ColorItemBase.ColorCode
    ColorItemBase.Columns
    ColorItemBase.Mode
    ColorItemBase.ModeSwitcher
    ColorItemBase.OnInitializedAsync()
    ColorItemBase.OnParametersSetAsync()
    ColorItemBase.Parent
    Namespace: Syncfusion.Blazor.RichTextEditor
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class RichTextEditorBackgroundColor : ColorItemBase
    Remarks

    Configure the background color tool appearance by specifying the value for the corresponding property.

    Examples

    In the following code example, configure the Default, ColorCode, and ModeSwitcher properties added using the RichTextEditorBackgroundColor tag directive.

    @using Syncfusion.Blazor.RichTextEditor;
    <SfRichTextEditor>
        <RichTextEditorToolbarSettings Items = "@Tools" />
        <RichTextEditorBackgroundColor ColorCode="@ColorList" ModeSwitcher="true" Default="#a5a5a5" />
    </SfRichTextEditor>
    @code {
        private List<ToolbarItemModel> Tools = new List<ToolbarItemModel>()
        {
            new ToolbarItemModel() { Command = ToolbarCommand.BackgroundColor }
        };
        private Dictionary<string, string[]> ColorList = new Dictionary<string, string[]>()
        {
            { "Custom", new string[]
                {
                    string.Empty, "#000000", "#e7e6e6", "#44546a", "#4472c4", "#ed7d31", "#a5a5a5", "#ffc000", "#70ad47", "#ff0000"
                }
            }
        };
    }

    Constructors

    RichTextEditorBackgroundColor()

    Declaration
    public RichTextEditorBackgroundColor()

    Properties

    Default

    Gets or sets the default background color applied to the text in the editor.

    Declaration
    public override string Default { get; set; }
    Property Value
    Type Description
    System.String

    The color used as the background for selected content. The default value is #ffff00.

    Overrides
    ColorItemBase.Default
    Remarks

    Setting this property allows you to define a default color that will be applied to text backgrounds when selected from the toolbar. This helps to provide a consistent look whenever background color formatting is applied.

    Methods

    Dispose(Boolean)

    Dispose unmanaged resources in the Syncfusion Blazor component.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    Boolean value to dispose the object.

    Overrides
    ColorItemBase.Dispose(Boolean)

    GetColorType()

    Used to get the dropdown type.

    Declaration
    protected override string GetColorType()
    Returns
    Type Description
    System.String

    Returns the dropdown type.

    Overrides
    ColorItemBase.GetColorType()

    PropertyChangeHandler(Dictionary<String, Object>.KeyCollection)

    Used to handle the dynamic property changes.

    Declaration
    protected override void PropertyChangeHandler(Dictionary<string, object>.KeyCollection keys)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary.KeyCollection<> keys

    Specifies the changed keys.

    Overrides
    ColorItemBase.PropertyChangeHandler(Dictionary<String, Object>.KeyCollection)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved