IKeyValuePair<K, V>
IKeyValuePair<K, V>
IKeyValuePair<K, V>
IKeyValuePair<K, V>
Interface
Definition
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.
public : interface IKeyValuePair<K, V>public interface IKeyValuePair<K, V>Public Interface IKeyValuePair<K, V>// You can use this interface in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.FoundationContract (introduced v1)
|
Remarks
When programming with .NET, this interface is hidden and developers should use the System.Collections.Generic.KeyValuePair<TKey,TValue> structure. In any case where a Windows Runtime type has implemented IKeyValuePair;, including when interfaces have inherited IKeyValuePair; or used it as an inner constraint, .NET code can treat it as a .NET KeyValuePair.
Key-value pairs are used in the IMap; interface, when it inherits IIterable;. Practical implementations of IMap; are iterable, and iterating or calling First /Current explicitly will return instances of IKeyValuePair; using the same constraints as does the IMap; implementation.
Properties
Key Key Key Key
Gets the key of the key-value pair.
public : K Key { get; }public K Key { get; }Public ReadOnly Property Key As K// You can use this property in JavaScript.
- Value
- K K K K
The key.
Remarks
When programming with .NET, this interface is hidden and developers should use the System.Collections.Generic.KeyValuePair<TKey,TValue> structure.
- See Also
Value Value Value Value
Gets the value of the key-value pair.
public : V Value { get; }public V Value { get; }Public ReadOnly Property Value As V// You can use this property in JavaScript.
- Value
- V V V V
The value.
Remarks
When programming with .NET, this interface is hidden and developers should use the System.Collections.Generic.KeyValuePair<TKey,TValue> structure.
- See Also