Windows.Foundation.Collections Windows.Foundation.Collections Windows.Foundation.Collections Namespace

Definition

Defines standard, specialized, and generic collection objects. This includes the IIterable;, IVector; and IMap; generic interfaces, which are used as the pattern for basic collection support throughout the Windows Runtime API.

Classes

PropertySet PropertySet PropertySet

Represents a property set, which is a set of PropertyValue objects with string keys.

StringMap StringMap StringMap

An associative collection, also known as a map or a dictionary.

ValueSet ValueSet ValueSet

Implements a map with keys of type String and values of type Object. This class prevents non-serializable types from being put into the map.

Note

Some members are only available for the specified language.

Interfaces

IIterable<T> IIterable<T> IIterable<T>

Exposes an iterator that supports simple iteration over a collection of a specified type.

.NET This interface appears as System.Collections.Generic.IEnumerable<T>. In any case where a Windows Runtime type has implemented IIterable;, .NET code can use the APIs of IEnumerable<T> instead. C# code can use foreach, Visual Basic code can use For Each...Next. All the .NET extension methods that are based on IEnumerable<T> and included in .NET for Windows Store app are accessible (including the System.Linq extensions, so long as you've included the namespace).

IIterator<T> IIterator<T> IIterator<T>

Supports simple iteration over a collection.

IKeyValuePair<K, V> IKeyValuePair<K, V> IKeyValuePair<K, V>

Represents a key-value pair. This is typically used as a constraint type when you need to encapsulate two type parameters into one to satisfy the constraints of another generic interface.

.NET This interface appears as System.Collections.Generic.KeyValuePair<TKey,TValue> (a structure, not an interface). In any case where a Windows Runtime type has implemented IKeyValuePair;, .NET code can use the APIs of KeyValuePair instead.

IMap<K, V> IMap<K, V> IMap<K, V>

Represents an associative collection, also known as a map or a dictionary.

.NET This interface appears to .NET code as System.Collections.Generic.IDictionary<TKey,TValue> due to .NET language projection. In any case where a Windows Runtime type has implemented IMap;, .NET code can use the APIs of IDictionary<TKey,TValue> instead.

IMapChangedEventArgs<K> IMapChangedEventArgs<K> IMapChangedEventArgs<K>

Provides data for the changed event of a map collection.

IMapView<K, V> IMapView<K, V> IMapView<K, V>

Represents an immutable view into a map.

.NET This interface appears as System.Collections.Generic.IReadOnlyDictionary<TKey,TValue> due to .NET language projection. In any case where a Windows Runtime type has implemented IMapView;, .NET code can use the APIs of IReadOnlyDictionary<TKey,TValue> instead.

IObservableMap<K, V> IObservableMap<K, V> IObservableMap<K, V>

Notifies listeners of dynamic changes to a map, such as when items are added or removed.

IObservableVector<T> IObservableVector<T> IObservableVector<T>

Notifies listeners of changes to the vector.

IPropertySet IPropertySet IPropertySet

Represents a collection of key-value pairs, correlating several other collection interfaces.

IVector<T> IVector<T> IVector<T>

Represents a random-access collection of elements.

.NET This interface appears to .NET code as System.Collections.Generic.IList<T> due to .NET language projection. In any case where a Windows Runtime type has implemented IVector;, .NET code can use the APIs of IList<T> instead.

IVectorChangedEventArgs IVectorChangedEventArgs IVectorChangedEventArgs

Provides data for the changed event of a vector.

IVectorView<T> IVectorView<T> IVectorView<T>

Represents an immutable view into a vector.

.NET This interface appears to .NET code as System.Collections.Generic.IReadOnlyList<T> due to .NET language projection. In any case where a Windows Runtime type has implemented IVectorView;, .NET code can use the APIs of IReadOnlyList<T> instead.

Enums

CollectionChange CollectionChange CollectionChange

Describes the action that causes a change to a collection.

Delegates

MapChangedEventHandler MapChangedEventHandler MapChangedEventHandler

Represents the method that handles the changed event of an observable map.

VectorChangedEventHandler VectorChangedEventHandler VectorChangedEventHandler

Represents the method that handles the changed event of an observable vector.

Remarks

Many of the interfaces and objects defined in this namespace have different language equivalents depending on the programming language you are using. For more info on using these interfaces from C++ code, see Collections (). For more info on using collection types from .NET code, see the Remarks in the specific types defined in this namespace.