【发布时间】:2020-04-11 21:36:00
【问题描述】:
如果这很明显,我对 C++ 还很陌生,很抱歉,但我无法访问类型 Windows::UI::Xaml::Controls::ItemCollection 上的属性“Size”。
这是我的代码:
Windows::UI::Xaml::Controls::ItemCollection& items = Items(); // Items in a property of Windows::UI::Xaml::Controls::GridView which my class derives from
auto count = items.Size(); // -> build error
错误是'winrt::impl::consume_Windows_Foundation_Collections_IVector::Size':返回'auto'的函数在定义之前不能使用
我知道 ItemCollection 有一个 Size 属性,为什么编译器会抱怨它没有定义。
任何帮助将不胜感激
谢谢
【问题讨论】:
标签: uwp c++17 winrt-xaml c++-winrt