Xaml 如何将Platform::Collections::Vector绑定到gridview

Xaml 如何将Platform::Collections::Vector绑定到gridview,xaml,data-binding,collections,uwp,c++-cx,Xaml,Data Binding,Collections,Uwp,C++ Cx,我试图将Platform::Collections::Vector绑定到GridView,但Visual Studio出现编译时错误: C3986 'get':the signature of the public member contains a native type 'std::equal_to<T>' C3986 'get':the signature of the public member contains a native type 'std::equal_to<

我试图将Platform::Collections::Vector绑定到GridView,但Visual Studio出现编译时错误:

C3986 'get':the signature of the public member contains a native type 'std::equal_to<T>'
C3986 'get':the signature of the public member contains a native type 'std::equal_to<T>'
C3986 'get':the signature of the public member contains a native type 'std::equal_to<T>'
C3986 'get':the signature of the public member contains a native type 'std::equal_to<T>'
C3986“get”:公共成员的签名包含本机类型“std::equal_to”
C3986“get”:公共成员的签名包含本机类型“std::equal_to”
C3986“get”:公共成员的签名包含本机类型“std::equal_to”
C3986“get”:公共成员的签名包含本机类型“std::equal_to”
导航页面.xaml.h

[Windows::Foundation::Metadata::WebHostHidden]
public ref class NavigationPage sealed
{
public:
    NavigationPage();
    property Platform::Collections::Vector<Platform::String^>^ ImagesProperty
    {
        Platform::Collections::Vector<Platform::String^>^ get()
        {
            if (Images == nullptr) Images = ref new Platform::Collections::Vector<Platform::String^>();
            return this->Images;
        };
    }


private:
    Platform::Collections::Vector<Platform::String^>^ Images;
};
[Windows::Foundation::Metadata::WebHostHidden]
公共参考类导航页已密封
{
公众:
导航页面();
属性平台::集合::向量^ImagesProperty
{
平台::集合::向量^get()
{
if(Images==nullptr)Images=ref新平台::集合::向量();
返回此->图像;
};
}
私人:
平台::集合::向量^Images;
};
NavigationPage.xaml

<GridView Grid.Row="1" x:Name="View" ItemSource="{x:Bind ImagesProperty}">
        <GridView.ItemTemplate>
            <DataTemplate>

            </DataTemplate>
        </GridView.ItemTemplate>
</GridView>

我已经尝试搜索谷歌,但是我发现的大多数例子都是用C++做的,如果C++的话,他们的目标是Windows 8/8.1,所以我决定在这里问最后一个资源。


目标版本:10586,最小版本:10586

对于那些可能遇到我同样问题的人,这里是代码,感谢Ed Plunkett发布的链接,我能够使它工作,问题是类Platform::Collections::Vector(有关his链接的详细信息)

公共:
导航页面();
属性Windows::Foundation::Collections::IObservableVector^ImagesProperty
{
Windows::Foundation::Collections::IObservableVector^get()
{
if(Images==nullptr)Images=ref新平台::集合::向量();
返回图像;
}
}
私人:
平台::集合::向量^Images;
};

如您所见,我隐式地将Vector类转换为IObservableVector

这是否解决了这个问题?嗯,我在Windows执行中遇到了麻烦::Field::IVector:但是,你的答案我可以猜想其余代码在语法上都是好的吗?我对C++过于生疏,对此问题进行了评论。问题解决了,谢谢你的帮助:DUnDy这个问题是EdPlunkett所链接的问题的一个副本,你应该添加一个答案。(请参阅更多信息)。您得到的错误是因为Stale::Vector是一个具体的C++类型,在XAML中实现iVector。,这是专门支持C++/CX数据绑定场景的。
public:
    NavigationPage();
    property Windows::Foundation::Collections::IObservableVector<Platform::String^>^ ImagesProperty 
    {
        Windows::Foundation::Collections::IObservableVector<Platform::String^>^ get() 
        {
            if (Images == nullptr) Images = ref new Platform::Collections::Vector<Platform::String^>();
            return Images;
        }
    }
private:
    Platform::Collections::Vector<Platform::String^>^ Images;
};