Skip to main content
A newer version of this page is available. .

ListLevelProperties Class

Contains the list level’s properties.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v21.2.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public class ListLevelProperties :
    IListLevelProperties,
    IListLevelProperties

Remarks

Pass a ListLevelProperties object to the ChangeLevelPropertiesAsync(Int32, Action<ListLevelProperties>) method to set a list level’s properties. You can specify list level properties manually or use the CopyFrom(ListLevel) method to copy properties from another list level.

<DxRichEdit @ref="richEdit" />

@code {
    DxRichEdit richEdit;
    Document documentAPI;
    @* ... *@
    /* Surround the code that contains an asynchronous operation with a try-catch block to handle
    the OperationCanceledException. This exception is thrown when an asynchronous operation is cancelled. */
        try {
            documentAPI = richEdit.DocumentAPI;
            @* ... *@
            List list = await documentAPI.Lists.CreateAsync(ListType.MultiLevel);
            IReadOnlyList<ListLevel> listLevels = list.ListLevels;
            ListLevel firstLevel = listLevels[0];
            @* ... *@
            for (int i = 1; i < 9; i++)
                await list.ChangeLevelPropertiesAsync(i, properties => {
                    properties.CopyFrom(firstLevel);
                    properties.LeftIndent = firstLevel.LeftIndent + 300 * i;
                    if (list.Type == ListType.Number)
                        properties.DisplayFormatString = "{" + i.ToString() + "}";
                });
                @* ... *@
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

Inheritance

Object
ListLevelProperties
See Also