Back to Devexpress

IBarSpinEdit Interface

blazor-devexpress-dot-blazor-dot-office-b0ecaf0a.md

latest2.5 KB
Original Source

IBarSpinEdit Interface

A spin editor on the Rich Text Editor‘s ribbon or toolbar.

Namespace : DevExpress.Blazor.Office

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public interface IBarSpinEdit :
    IBarItem,
    IBarItemBase

The following members return IBarSpinEdit objects:

Remarks

The following code snippet creates a custom spin editor.

razor
<DxRichEdit CustomizeToolbar=OnCustomizeToolbar BarMode=BarMode.Toolbar/>

@code {
    void OnCustomizeToolbar(IToolbar toolbar) {
        BarGroupCollection groups = toolbar.Groups;
        groups.Clear();
        AddFormattingGroup(groups);
        // ...
    }

    void AddFormattingGroup(BarGroupCollection groups) {
        IBarGroup formattingGroup = groups.AddCustomGroup();
        // ...

        // Adds a custom spin editor
        IBarSpinEdit spinEdit = formattingGroup.Items.AddCustomSpinEdit(
            () => currentLeftIndent,
            async (value) => {
                currentLeftIndent = value;
                Paragraph paragraph = await GetCurrentParagraph();
                await paragraph.ChangePropertiesAsync(p => p.LeftIndent = UnitConverter.InchesToTwips((float)value));
            }
        );
        spinEdit.MinValue = -11;
        spinEdit.MaxValue = 22;
        spinEdit.Increment = 0.1m;
        spinEdit.CssClass = "paragraph-left-indent-spinedit";
        spinEdit.Text = "Left indent:";
        spinEdit.Tooltip = "Change the indent of the paragraph under the caret.";
    }    
}

Run Demo: Toolbar Customization

See Also

IBarSpinEdit Members

DevExpress.Blazor.Office Namespace