我有以下对象:
public class EventCounter : INotifyPropertyChanged
{
private int _count = 0;
public int Count {
get
{
return _count;
}
set
{
_count = value;
NotifyPropertyChanged("Count");
}
}
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this,
new PropertyChangedEventArgs(propertyName));
}
}
}
我希望每次使用"弱事件模式更改计数值时都会收到通知"
我该怎么做?