【发布时间】:2014-01-06 00:04:28
【问题描述】:
我有一个使用 Fody 将 INotifyPropertyChanged 注入属性的 Windows Phone 8 应用程序。 我有 Class First,属性 A 绑定到 View 中的文本框:
[ImplementPropertyChanged]
public class First
{
public int A { get; set; }
public int AA { get {return A + 1; } }
}
第二类属性 B 取决于属性 A(也绑定到文本框):
[ImplementPropertyChanged]
public class Second
{
private First first;
public int B { get {return first.A + 1; } }
}
更新 A 和 AA 工作正常,但是 B 不会在 first.A 更改时自动更新。有没有一种简单干净的方法来使用 fody 实现这种自动更新,还是我必须创建自己的事件来处理它?
【问题讨论】:
标签: c# mvvm windows-phone-8 inotifypropertychanged fody-propertychanged