Share via


IBindableVectorView.IndexOf(Object, UInt32) 方法

定义

返回向量中指定项的索引。

public:
 bool IndexOf(Platform::Object ^ value, [Out] unsigned int & index);
bool IndexOf(IInspectable const& value, [Out] uint32_t & index);
public bool IndexOf(object value, out uint index);
Public Function IndexOf (value As Object, ByRef index As UInteger) As Boolean

参数

value
Object

Platform::Object

IInspectable

在向量中查找的项。

index
UInt32

unsigned int

uint32_t

项的从零开始的索引(如果找到)。 如果未找到该项,则返回 0,因此请务必检查返回值。

返回

Boolean

bool

如果找到该项,则为 true;如果找不到该项,则为 false

注解

此接口支持在 C++ 中创建数据可绑定集合。 使用 .NET 编程时,应使用 ObservableCollection (Of T) 或实现 IListINotifyCollectionChanged

适用于

另请参阅