2

创建面向 .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?
4

1 回答 1

5

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

public event PropertyChangedEventHandler PropertyChanged;

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

于 2017-02-23T03:36:48.900 回答