Movatterモバイル変換


[0]ホーム

URL:


Skip to main contentSkip to in-page navigation

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

Windows.Foundation.Collections Namespace

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Defines standard, specialized, and generic collection objects. This includes theIIterable<T>,IVector<T> andIMap<K,V> generic interfaces, which are used as the pattern for basic collection support throughout the Windows Runtime API.

Classes

NameDescription
PropertySet

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

StringMap

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

ValueSet

Implements a map with keys of typeString and values of typeObject. Object must be a WinRTPropertyValue or ValueSet. As a PropertyValue, it can be any type exceptPropertyTypeInspectableArray. This limitation exists to ensure that the value can be serialized; passed by value across a process boundary.

Note

Some members are only available for the specified language.

Interfaces

NameDescription
IIterable<T>

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

.NETThis interface appears asSystem.Collections.Generic.IEnumerable<T>. In any case where a Windows Runtime type has implemented IIterable<T>, .NET code can use the APIs ofIEnumerable<T> instead. C# code can useforeach, Visual Basic code can useFor Each...Next. All the .NET extension methods that are based onIEnumerable<T> and included in .NET for UWP apps are accessible (including theSystem.Linq extensions, so long as you've included the namespace).

IIterator<T>

Supports simple iteration over a collection.

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.

Note

In .NET, this interface appears asSystem.Collections.Generic.KeyValuePair<TKey,TValue> (a structure, not an interface). In any case where a Windows Runtime type has implemented IKeyValuePair<K,V>, .NET code can use the APIs ofKeyValuePair instead.

IMap<K,V>

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

.NETThis interface appears to .NET code asSystem.Collections.Generic.IDictionary<TKey,TValue> due to .NET language projection. In any case where a Windows Runtime type has implemented IMap<K,V>, .NET code can use the APIs ofIDictionary<TKey,TValue> instead.

IMapChangedEventArgs<K>

Provides data for the changed event of a map collection.

IMapView<K,V>

Represents an immutable view into a map.

.NETThis interface appears asSystem.Collections.Generic.IReadOnlyDictionary<TKey,TValue> due to .NET language projection. In any case where a Windows Runtime type has implemented IMapView<K,V>, .NET code can use the APIs ofIReadOnlyDictionary<TKey,TValue> instead.

IObservableMap<K,V>

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

IObservableVector<T>

Notifies listeners of changes to the vector.

IPropertySet

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

IVector<T>

Represents a random-access collection of elements.

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

IVectorChangedEventArgs

Provides data for the changed event of a vector.

IVectorView<T>

Represents an immutable view into a vector.

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

Enums

NameDescription
CollectionChange

Describes the action that causes a change to a collection.

Delegates

NameDescription
MapChangedEventHandler<K,V>

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

VectorChangedEventHandler<T>

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, seeCollections (C++/CX). For more info on using collection types from .NET code, see the Remarks in the specific types defined in this namespace.

See also


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?