ItemCollection
ItemCollection
ItemCollection
ItemCollection
Class
Definition
Holds the list of items that represent the content of an ItemsControl.
public : sealed class ItemCollection : IIterable<Platform::Object>, IObservableVector<Platform::Object>, IVector<Platform::Object>
struct winrt::Windows::UI::Xaml::Controls::ItemCollection : IIterable<Platform::Object>, IObservableVector<Platform::Object>, IVector<Platform::Object>
public sealed class ItemCollection : IEnumerable<Object>, IObservableVector<Object>, IList<Object>
Public NotInheritable Class ItemCollection Implements IEnumerable<Object>, IObservableVector<Object>, IList<Object>
<ItemsControl>
oneOrMoreFrameworkElements
</ItemsControl>
- Attributes
Device family |
Windows 10 (introduced v10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
Enumerating the collection in C# or Microsoft Visual Basic
An ItemCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable
explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable
Properties
Item[Int32] Item[Int32] Item[Int32] Item[Int32] |
Gets or sets the element at the specified index. |
Size Size Size Size |
Gets the size (count) of the collection. |
Methods
Events
VectorChanged VectorChanged VectorChanged VectorChanged |
Occurs when the items list of the collection has changed, or the collection is reset. |