public class OrderInfo : INotifyPropertyChanged
{
private int? orderID;
private CustomerInfo customersinfo;
//Complex Property
public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged(String Name)
{
if (PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(Name));
}
public int? OrderID
{
get { return orderID; }
set { this.orderID = value; RaisePropertyChanged("OrderID"); }
}
//Complex Property
public CustomerInfo CustomersInfo
{
get { return customersinfo; }
set
{
this.customersinfo = value;
RaisePropertyChanged("CustomersInfo");
this.CustomersInfo.PropertyChanged += CustomersInfo_PropertyChanged;
}
}
private void CustomersInfo_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
RaisePropertyChanged("CustomersInfo." + e.PropertyName);
}
public OrderInfo()
{
}
}
public class CustomerInfo : NotificationObject
{
private string firstName;
public string FirstName
{
get { return firstName; }
set
{
this.firstName = value;
RaisePropertyChanged("FirstName");
}
}
}
|