TX Text Control .NET for WPF

Level Property

Property
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets or sets the level for a bulleted or numbered list.

Syntax

public int Level { get; set; }

Examples

The following example applies Level while converting three selected paragraphs into a usable numbered list.

textControl.Text = "Research\nDraft\nReview";
textControl.Select(0, textControl.Text.Length);

ListFormat listFormat = new()
{
    Type = ListType.Numbered,
    Level = 2
};
textControl.Selection.ListFormat = listFormat;

Limitations

The level of a list must be between 1 and ListFormat.MaxLevel.

Remarks

The property's default value is 1.

The property returns its default value when the text selection contains multiple paragraphs with different levels or when the text selection does not contain a bulleted or a numbered list. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.