Windows Dev Center

IPropertySet interface

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

Syntax


Public Interface IPropertySet 
    Inherits IObservableMap(Of String, Object), IDictionary(Of String, Object), IEnumerable(Of KeyValuePair)

Attributes

[Version(0x06020000)]

Members

The IPropertySet interface does not define any members.

Remarks

This interface is unusual in that it doesn't define any new members. Instead, it correlates three other collection interfaces such that they share the same type parameter constraints:

If you cast an object to IPropertySet (which isn't a generic) you can then use the combined methods of these three interfaces based on using String for key, Object for value. For a practical implementation, Windows Runtime uses the PropertySet class. See the documentation for various members of PropertySet to learn how to use those methods once you cast as IPropertySet.

In many cases where a Windows Runtime API uses a PropertySet as a value, it's actually shown as IPropertySet in the signatures. PropertySet can be considered the practical implementation of IPropertySet that's ready for use by app code. JavaScript code can treat any IPropertySet value as if it implemented the PropertySet prototypes. Usage by type is the main scenario for IPropertySet; actually implementing the interface in your app code is less common.

IPropertySet is also implemented by the ValueSet class. ValueSet is the value type of several ContinuationData properties, which enable restoring state when apps resume after calling an AndContinue method that might deactivate the app. ValueSet and all the ContinuationData properties and AndContinue methods are Windows Phone only APIs because it's only Windows Phone that has this behavior. For more info, see How to continue your Windows Phone Store app after calling an AndContinue method. The difference between ValueSet and PropertySet is that the ValueSet implementation of methods like Insert/Add enforces that its property values are value types.

Examples

This example shows how to check for an item within the IPropertySet object returned by a Windows Runtime property. Specifically, this is from the CoreApplication.Properties property. This code snippet comes from the ControlChannelT​rigger HTTP client sample. Note how the C# version casts to IDictionary<string,object> so that it can use the indexer, whereas the C++/CX version uses HasKey and Lookup. Typically this is all you do with an IPropertySet object that you get from the various Windows Runtime properties that return the type: look for specific keys in the property set, and then set some app property to the corresponding value if it exists.

No code example is currently available or this language may not be supported.

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.FoundationContract, introduced version 1.0

Namespace

Windows.Foundation.Collections
Windows::Foundation::Collections [C++]

Metadata

Windows.Foundation.FoundationContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Foundation.Collections
Windows::Foundation::Collections [C++]

Metadata

Windows.winmd

See also

IObservableMap(String, Object)
IMap(String, Object)
IIterable(IKeyValuePair)
PropertySet

 

 

Show:
© 2015 Microsoft