I have a simple class. I can change it's properties and get notified. but the object instance property changed does not change when I change any of it's properties. How can I change the object instance property changed to enable the below event to be raised?
public class A : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public int _id;
public int Id
{
get { return _id; }
set
{
if (_id == value)
{
return;
}
_id = value;
OnPropertyChanged("Id");
}
}
public string _name;
public string Name
{
get { return _name; }
set
{
if (_name == value)
{
return;
}
_name = value;
OnPropertyChanged("Name");
}
}
}
foreach (INotifyPropertyChanged item in new ObservableCollection<A>() )
item.PropertyChanged += new PropertyChangedEventHandler(Item_PropertyChanged);
private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
}