IMapView<K, V>
IMapView<K, V>
IMapView<K, V>
IMapView<K, V>
IMapView<K, V>
Interface
Definition
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.
public : interface IMapView<K, V> : IIterable<IKeyValuePair<K, V>>
struct winrt::Windows::Foundation::Collections::IMapView<K, V> : IIterable<IKeyValuePair<K, V>>
public interface IMapView<K, V> : IEnumerable<KeyValuePair<K, V>>
Public Interface IMapView<K, V> Implements IEnumerable<KeyValuePair<K, V>>
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.
- 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.IReadOnlyDictionary<TKey,TValue> interface if they want to implement a read-only map/dictionary type. In any case where a Windows Runtime type has implemented IMapView;, .NET code can use the APIs of IReadOnlyDictionary<TKey,TValue> instead. This includes all the existing Windows Runtime API and also scenarios such as using the APIs of Windows Runtime components originally implemented in Visual C++ component extensions (C++/CX) from a C# or Visual Basic app.
The IMapView; interface represents a collection of key-value pairs where a value can be accessed by its associated key. Properties and methods of IMapView; support dictionary-type functionality, such as getting the size of the collection, or lookups, but don't support adding or removing items because the map is read-only.
Interface inheritance
IMapView inherits IIterable, using an IKeyValuePair constraint. Types that implement IMapView also implement the interface members of IKeyValuePair, with an IKeyValuePair type constraint. Similarly, if you're using .NET, there is support for IEnumerable
Properties
Size Size Size Size Size |
Gets the number of elements in the map. |
Methods
HasKey(K) HasKey(K) HasKey(K) HasKey(K) HasKey(K) |
Determines whether the map view contains the specified key. |
Lookup(K) Lookup(K) Lookup(K) Lookup(K) Lookup(K) |
Returns the item at the specified key in the map view. |
Split(IMapView<K, V>, IMapView<K, V>) Split(IMapView<K, V>, IMapView<K, V>) Split(IMapView<K, V>, IMapView<K, V>) Split(IMapView<K, V>, IMapView<K, V>) Split(IMapView<K, V>, IMapView<K, V>) |
Splits the map view into two views. |