ListItem Constructors

Definition

Initializes a new instance of the ListItem class.

Overloads

ListItem()

Initializes a new, empty instance of the ListItem class.

ListItem(Paragraph)

Initializes a new instance of the ListItem class, taking a specified Paragraph object as the initial contents of the new ListItem.

ListItem()

Initializes a new, empty instance of the ListItem class.

C#
public ListItem();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

ListItem(Paragraph)

Initializes a new instance of the ListItem class, taking a specified Paragraph object as the initial contents of the new ListItem.

C#
public ListItem(System.Windows.Documents.Paragraph paragraph);

Parameters

paragraph
Paragraph

A Paragraph object specifying the initial contents of the new ListItem.

Examples

The following example demonstrates usage of this constructor.

C#
// This line uses the ListItem constructor to create a new ListItem
// and initialize it with the specified Paragraph.
ListItem lix = new ListItem(new Paragraph(new Run("ListItem text...")));
// This line uses the List constructor to create a new List and populate
// it with the previously created ListItem.
List listx = new List(lix);

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10