创建面向.net 4.5.1的winform项目
安装包PropertyChanged.Fody
[ImplementPropertyChanged]
public class PersonFody
{
public string Name { get; set; }
}
PersonFody _fod = new PersonFody();
_fod. //Name is the only property and no events to subscribe
Is it possible to subscribe to a PropertyChanged event at design time using fody?
最佳答案
我想这已经晚了,但是是的,你可以。只需将此事件添加到您的类(class)即可:
public event PropertyChangedEventHandler PropertyChanged;
Fody 将识别您拥有 IPropertyChanged 接口(interface)的正确事件,并连接您的所有属性以触发该事件。
关于fody-propertychanged - 如何使用 Fody-propertychanged 订阅 PropertyChange 事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35876338/