I have dictionary like this :
public Dictionary<string, string> fields
{
get
{
}
set
{
}
}
How can I fire event which will keep listening to this dictionary? And as soon as something is changed in the event some event handler should be called. Is it possible to do it without making this dictionary observable?
private int _age;
public event System.EventHandler AgeChanged;
protected virtual void OnAgeChanged()
{
if (AgeChanged != null) AgeChanged(this,EventArgs.Empty);
}
public int Age
{
get
{
return _age;
}
set
{
_age=value;
OnAgeChanged();
}
}
I don't want the above implementation.