vendredi 27 février 2015

Listen Property Changed Events in a weak mode for Windows Phone 8.1 RT

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