如何使用 Fody-propertychanged 订阅 PropertyChange 事件



创建针对 .net 的 winform 项目 4.5.1

安装包属性已更改.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?
我想

这已经晚了,但是是的,你可以。只需将此事件添加到您的班级中:

public event PropertyChangedEventHandler PropertyChanged;

Fody 将识别出您具有 IPropertyChanged 接口的正确事件,并连接您的所有属性以触发该事件。

最新更新