ListItemCollection Class

Represents a collection of ListItem elements. ListItemCollection defines the allowable child content of a List element.

Namespace:  System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)

public class ListItemCollection : TextElementCollection<ListItem>

The ListItemCollection type exposes the following members.

  NameDescription
Public propertyCountGets the number of items currently in the collection. (Inherited from TextElementCollection<TextElementType>.)
Public propertyFirstListItemGets the first ListItem element within this instance of ListItemCollection.
Public propertyIsReadOnlyGets a value that indicates whether or not the collection is read-only. (Inherited from TextElementCollection<TextElementType>.)
Public propertyLastListItemGets the last ListItem element within this instance of ListItemCollection.
Top

  NameDescription
Public methodAddAppends a specified item to the collection. (Inherited from TextElementCollection<TextElementType>.)
Public methodAddRangeAppends a specified range of items to the collection. (Inherited from TextElementCollection<TextElementType>.)
Public methodClearClears all items from the collection. (Inherited from TextElementCollection<TextElementType>.)
Public methodContainsQueries for the presence of a specified item in the collection. (Inherited from TextElementCollection<TextElementType>.)
Public methodCopyToCopies the contents of the collection and inserts them into a specified array starting at a specified index position in the array. (Inherited from TextElementCollection<TextElementType>.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator for the contents of the collection. (Inherited from TextElementCollection<TextElementType>.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInsertAfterInserts a specified item in the collection after a specified collection item. (Inherited from TextElementCollection<TextElementType>.)
Public methodInsertBeforeInserts a specified item in the collection before a specified collection item. (Inherited from TextElementCollection<TextElementType>.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemoveRemoves a specified item from the collection. (Inherited from TextElementCollection<TextElementType>.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection.CopyToCopies the elements of the ICollection to an Array, starting at a particular Array index.. Use the type-safe CopyTo method instead. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate propertyICollection.CountGets the number of elements contained in the ICollection. Use the type-safe Count property instead. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedGets a value indicating whether access to the ICollection is synchronized (thread safe). (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate propertyICollection.SyncRootGets an object that can be used to synchronize access to the ICollection. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator that iterates through a collection. Use the type-safe GetEnumerator method instead. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate methodIList.AddAdds an item to the IList. Use the type-safe Add method instead. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate methodIList.ClearThis type or member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. Use the type-safe Clear method instead. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate methodIList.ContainsDetermines whether the IList contains a specific value.. Use the type-safe Contains method instead. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate methodIList.IndexOfDetermines the index of a specific item in the IList. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate methodIList.InsertInserts an item to the IList at the specified index. Use the type-safe InsertAfter or InsertBefore methods instead. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate propertyIList.IsFixedSizeGets a value indicating whether the IList has a fixed size. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate propertyIList.IsReadOnlyGets a value indicating whether the IList is read-only. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate propertyIList.ItemGets or sets the element at the specified index. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate methodIList.RemoveRemoves the first occurrence of a specific object from the IList. Use the type-safe Remove method instead. (Inherited from TextElementCollection<TextElementType>.)
Explicit interface implemetationPrivate methodIList.RemoveAtRemoves the IList item at the specified index. (Inherited from TextElementCollection<TextElementType>.)
Top

ListItemCollection creation is only permitted inside a List object. As such, a ListItemCollection cannot be instantiated directly and has no default or overloaded constructor.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft