IVectorView<T> IVectorView<T> IVectorView<T> IVectorView<T> IVectorView<T> Interface

Definition

Represents an immutable view into a vector.

.NET This interface appears to .NET code as System.Collections.Generic.IReadOnlyList due to .NET language projection. In any case where a Windows Runtime type has implemented IVectorView;, .NET code can use the APIs of IReadOnlyList instead.

public : interface IVectorView<T> : IIterable<T>
struct winrt::Windows::Foundation::Collections::IVectorView<T> : IIterable<T>
public interface IVectorView<T> : IEnumerable<T>
Public Interface IVectorView<T> Implements IEnumerable<T>
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.FoundationContract (introduced v1)

Remarks

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

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

Properties

Size Size Size Size Size

Gets the number of items in the vector view.

Methods

GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)

Returns the item at the specified index in the vector view.

GetMany(UInt32, T[]) GetMany(UInt32, T[]) GetMany(UInt32, T[]) GetMany(UInt32, T[]) GetMany(UInt32, T[])

Gets a collection of items from the vector view beginning at the given index.

IndexOf(T, UInt32) IndexOf(T, UInt32) IndexOf(T, UInt32) IndexOf(T, UInt32) IndexOf(T, UInt32)

Retrieves the index of a specified item in the vector view.