Share via


IBindableIterator 接口

定义

支持对集合的可绑定迭代。

public interface class IBindableIterator
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(1780313095, 1901, 18930, 131, 20, 245, 44, 156, 154, 131, 49)]
struct IBindableIterator
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(1780313095, 1901, 18930, 131, 20, 245, 44, 156, 154, 131, 49)]
public interface IBindableIterator
Public Interface IBindableIterator
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

此接口支持在 C++ 中创建数据可绑定集合。 使用 .NET 编程时,应使用 ObservableCollection (Of T) 或实现 IListINotifyCollectionChanged。 有关详细信息,请参阅 绑定到集合

C++/WinRT 扩展函数

注意

某些Windows 运行时 API 的 C++/WinRT 投影类型上存在扩展函数。 例如, winrt::Windows::Foundation::IAsyncActionIAsyncAction 的 C++/WinRT 投影类型。 扩展函数不是应用程序二进制接口 (ABI) 实际Windows 运行时类型的图面的一部分,因此它们不会列为Windows 运行时 API 的成员。 但可以从任何 C++/WinRT 项目中调用它们。 请参阅扩展Windows 运行时 API 的 C++/WinRT 函数

auto begin() const;

返回集合的第一个元素的迭代器,以便在 C++ 算法(如基于 for 范围的循环)中使用。

auto end() const;

将迭代器返回到集合最后一个元素之后的迭代器,以便在 C++ 算法(如基于 for 范围的循环)中使用。

operator++();
operator++(int);

这些运算符允许对Windows 运行时可迭代对象进行范围 for 循环。 前缀和后缀 ++ 运算符前移迭代器,如果迭代器已完成,则将其设置为 nullptr

T operator*() const;

取消引用迭代器等效于调用 Current

using iterator_concept= std::input_iterator_tag;
using iterator_catetory = std::input_iterator_tag;
using value_type = T;
using difference_type = ptrdiff_t;
using pointer = void;
using reference = T;

提高与 C++ 迭代器的互操作性的嵌套类型。

属性

Current

获取集合中的当前项。

HasCurrent

获取一个值,该值指示集合末尾是存在当前项还是迭代器。

方法

MoveNext()

将迭代器向前移动到下一项,并返回 HasCurrent

适用于

另请参阅