Editar

Partilhar via


List Constructors

Definition

Initializes a new instance of the List class.

Overloads

List()

Initializes a new, empty instance of the List class.

List(ListItem)

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

List()

Initializes a new, empty instance of the List class.

public:
 List();
public List ();
Public Sub New ()

Applies to

List(ListItem)

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

public:
 List(System::Windows::Documents::ListItem ^ listItem);
public List (System.Windows.Documents.ListItem listItem);
new System.Windows.Documents.List : System.Windows.Documents.ListItem -> System.Windows.Documents.List
Public Sub New (listItem As ListItem)

Parameters

listItem
ListItem

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

Examples

The following example demonstrates usage of this constructor.

// 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);
' This line uses the ListItem constructor to create a new ListItem
' and initialize it with the specified Paragraph.
Dim lix As 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.
Dim listx As New List(lix)

Applies to