Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IVectorView<T> interface

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<T>, .NET code can use the APIs of IReadOnlyList<T> instead.

Syntax


generic<typename T>
public interface class IVectorView : IIterable<T>

Type parameters

T

The type of the values in the vector.

Members

The IVectorView interface inherits from IIterable(T). IVectorView also has these types of members:

Methods

The IVectorView interface has these methods. It also inherits methods from the Object class.

MethodDescription
GetAt Returns the item at the specified index in the vector view.
GetMany Retrieves the items that start at the specified index in the vector view.
IndexOf Retrieves the index of a specified item in the vector view.

 

Properties

The IVectorView interface has these properties.

PropertyAccess typeDescription

Size

Read-onlyGets the number of items in the vector view.

 

Remarks

For read-write collections, the IVectorView<T> interface is still relevant, because the IVector.GetView method returns an IVectorView<T> instance.

When programming with .NET, this interface is hidden and developers should use the System.Collections.Generic.IReadOnlyList<T> interface if they want to implement a read-only vector/list type. In any case where a Windows Runtime type has implemented IVectorView<T>, .NET code can use the APIs of IReadOnlyList<T> 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.

Interface inheritance

IVectorView inherits IIterable. Types that implement IVectorView also implement the interface members of IIterable. Similarly, if you're using .NET, there is support for IEnumerable<T>.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.FoundationContract, introduced version 1.0

Namespace

Windows::Foundation::Collections

Metadata

Windows.Foundation.FoundationContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows::Foundation::Collections

Metadata

Windows.winmd

Attributes

[Version(0x06020000)]

See also

IIterable<T>
IVector.GetView
System.Collections.Generic.IReadOnlyList<T>
Collections (C++/CX)

 

 

Show:
© 2015 Microsoft