【发布时间】:2021-11-21 10:52:23
【问题描述】:
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
这里相当于
public string Name{ get; set; } right?
类变量也是如此
public NewsItem ns { get { return this.DataContext as NewsItem; } }
和
public NewsItem ns{get;}
他们是一样的吗???? 如果不是,公共 NewsItem ns{get;}
中的默认返回值将是什么this.DataContext 的含义是什么
public NewsItem ns { get { return this.DataContext as NewsItem; } }
如果代码是这样的,返回值是什么
public NewsItem ns { get { return this.DataContext} }
提前致谢
【问题讨论】:
-
如果答案已经解决了您的问题,请mark它被接受
标签: data-binding uwp uwp-xaml datacontext