My question is almost like the following existing question: When nesting properties that implement INotifyPropertyChanged must the parent object propogate changes?
My question is If I have three levels as follows Person Contact Address
public class Address : INotifyPropertyChanged
{
string m_city;
public string City
{
get { return m_city; }
set
{
m_city = value;
NotifyPropertyChanged(new PropertyChangedEventArgs("City"));
}
}
}
public class Contact : INotifyPropertyChanged
{
Address m_address;
public Address Address
{
get { return m_address = value; }
set
{
m_address = value;
NotifyPropertyChanged(new PropertyChangedEventArgs("Address"));
}
}
}
public class Person : INotifyPropertyChanged
{
Contact m_contact;
public Contact ContactInfo
{
get { return m_contact = value; }
set
{
m_contact = value;
NotifyPropertyChanged(new PropertyChangedEventArgs("ContactInfo"));
}
}
}
I have a person User control that contains a contact user control. When I change the city it calls notifyPropertychanged of the city property at the address class. and It doesn't call neither the Address setter under Contact class nor Contact setter under Person class. How can I notify the person class when the city property changed???