TX Text Control .NET for WPF

NumberedListFormat Property

Property|Introduced in 16.0
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 number format for a numbered list at the current input position. If text is selected, the property specifies this attribute for the whole selected text. This property determines the number format for the NumberedList property. The property's value is a member of the NumberFormat enumeration.

Syntax

public NumberFormat NumberedListFormat { get; set; }

Members

ValueDescription
ArabicNumbersThe list is numbered with Arabic numbers (1, 2, 3...).
LettersThe list is numbered with letters (a, b, c...).
CapitalLettersThe list is numbered with capital letters (A, B, C...).
RomanNumbersThe list is numbered with Roman numbers (I, II, III...).
SmallRomanNumbersThe list is numbered with small Roman numbers (i, ii, iii...).

Examples

The following XAML example shows how to bind radio buttons to the NumberedListFormat property using the WPF.BooleanConverter class and the NumberFormats property.

…
xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
…
<Window.Resources>
    <tx:BooleanConverter x:Key="boolConv" />
</Window.Resources>
…
<RadioButton
    Content="{Binding ElementName=textControl1, Path=InputFormat.NumberFormats[0], Mode=OneTime}"
    GroupName="numberFormat"
    IsChecked="{Binding
        ElementName=textControl1,
        Path=InputFormat.NumberedListFormat,
        Converter={StaticResource boolConv},
        ConverterParameter=ArabicNumbers}" />
<RadioButton
    Content="{Binding ElementName=textControl1, Path=InputFormat.NumberFormats[1], Mode=OneTime}"
    GroupName="numberFormat"
    IsChecked="{Binding
        ElementName=textControl1,
        Path=InputFormat.NumberedListFormat,
        Converter={StaticResource boolConv},
        ConverterParameter=Letters}" />
…

The following example changes the formatting applied to text entered at the end of a document by using InputFormat.NumberedListFormat.

textControl.Text = "Project summary";
textControl.InputPosition = new InputPosition(textControl.Text.Length);
InputFormat inputFormat = textControl.InputFormat;

inputFormat.NumberedListFormat = NumberFormat.ArabicNumbers;
Console.WriteLine($"Numbered List Format used by Input Format: {inputFormat.NumberedListFormat}");

Remarks

The property's default value is NumberFormat.ArabicNumbers.

The property returns NumberFormat.None, if the text selection has no common number format.