I have the following object:
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));
}
}
}
And I want to get notified everytime the Count value is changed with with a "weak event pattern"
How can I do it?
Aucun commentaire:
Enregistrer un commentaire