Skip to main content

ListLevel Class

Contains the list level’s properties.

Namespace: DevExpress.Blazor.RichEdit

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

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public class ListLevel :
    IListLevelProperties,
    IListLevelProperties

Remarks

A list includes 9 nesting levels from 0 to 8. Use a list’s ListLevels property to get the list level collection.

A list’s Type property defines the default settings for all list levels. Call the ChangeLevelPropertiesAsync(Int32, Action<ListLevelProperties>, CancellationToken) method to change a list level’s properties. You can specify list level properties manually or call 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 canceled. */
        try {
            documentAPI = richEdit.DocumentAPI;
            List multiLevelList = await documentAPI.Lists.CreateAsync(ListType.MultiLevel);
            IReadOnlyList<ListLevel> listLevels = multiLevelList.ListLevels;
            ListLevel firstLevel = listLevels[0];
            for (int i = 1; i < 9; i++)
                await multiLevelList.ChangeLevelPropertiesAsync(i, properties => {
                    properties.CopyFrom(firstLevel);
                    properties.LeftIndent = firstLevel.LeftIndent + 300 * i;
                    if (multiLevelList.Type == ListType.Number)
                        properties.DisplayFormatString = "{" + i.ToString() + "}";
                });
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}

Inheritance

Object
ListLevel
See Also