我有一些我想简化的代码。 下面是代码:使用属性来引发事件
private int id;
public int Id
{
get { return id; }
set
{
id = value;
base.OnPropertyChanged("Id");
}
}
我使用的属性想着只得到:
[RaiseOnPropertyChanged()]
public int Id { get; set; }
那怎么可以呢?或者可以使用属性来完成?
请参阅http://stackoverflow.com/questions/488587/whats-the-best-way-to-call-inotifypropertychangeds-propertychanged-event – 2009-12-29 19:30:32