List.ListItems Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém um ListItemCollection contendo os ListItem elementos que compõem o conteúdo do List.
public:
property System::Windows::Documents::ListItemCollection ^ ListItems { System::Windows::Documents::ListItemCollection ^ get(); };
public System.Windows.Documents.ListItemCollection ListItems { get; }
member this.ListItems : System.Windows.Documents.ListItemCollection
Public ReadOnly Property ListItems As ListItemCollection
Valor de Propriedade
A contendo ListItemCollection os ListItem elementos que compõem o conteúdo do List.
Esta propriedade não tem valor padrão.
Exemplos
Os exemplos seguintes mostram como realizar operações comuns em um List usando a ListItems propriedade.
// Add ListItems to the List.
List listx = new List();
Span spanx = new Span();
listx.ListItems.Add(new ListItem(new Paragraph(new Run("A bit of text content..."))));
listx.ListItems.Add(new ListItem(new Paragraph(new Run("A bit more text content..."))));
// Insert a ListItem at the begining of the List.
ListItem lix = new ListItem(new Paragraph(new Run("ListItem to insert...")));
listx.ListItems.InsertBefore(listx.ListItems.FirstListItem, lix);
// Get the number of ListItems in the List.
int countListItems = listx.ListItems.Count;
// Remove the last ListItem from the List.
listx.ListItems.Remove(listx.ListItems.LastListItem);
// Clear all of the ListItems from the List.
listx.ListItems.Clear();
' Add ListItems to the List.
Dim listx As New List()
Dim spanx As New Span()
listx.ListItems.Add(New ListItem(New Paragraph(New Run("A bit of text content..."))))
listx.ListItems.Add(New ListItem(New Paragraph(New Run("A bit more text content..."))))
' Insert a ListItem at the begining of the List.
Dim lix As New ListItem(New Paragraph(New Run("ListItem to insert...")))
listx.ListItems.InsertBefore(listx.ListItems.FirstListItem, lix)
' Get the number of ListItems in the List.
Dim countListItems As Integer = listx.ListItems.Count
' Remove the last ListItem from the List.
listx.ListItems.Remove(listx.ListItems.LastListItem)
' Clear all of the ListItems from the List.
listx.ListItems.Clear()
Observações
Use o ListItemCollection retorno por esta propriedade para enumerar ou manipular o conteúdo de um List elemento.