【发布时间】:2016-03-02 14:22:39
【问题描述】:
我的应用程序中有一个 C++ 类testclient:
namespace testclient{
namespace models{
ref class myclass sealed{
public:
myclass();
property String^ getstring
{
String^ get()
{
return string;
}
}
private:
String^ string = "test";
}}}
我想将控件绑定到属性getstring,根据我对 UWP XAML 数据绑定的了解,我必须将其包含在 MainPage.xaml 的顶部:xmlns:data="using:testclient.models 问题是,智能感知是告诉我“未定义的命名空间。‘使用’URI 引用了一个名为 testclient.models 的命名空间,但找不到该命名空间。”我做错了什么?
编辑:当我将类放在 Mainpage.Xaml.h 中时,我发现问题消失了,但我宁愿不这样做......
【问题讨论】:
标签: xaml data-binding uwp c++-cx