我有一个表格中WPF与2文本框:WPF绑定:对象在对象
<TextBox Name="txtName" Text="{Binding Contact.Name}"/>
<TextBox Name="txtAddressNumber" Text="{Binding Contact.Address.Number}"/>
和我有2类:
public class ContactEntity
{
public string Name {get;set;}
public AddressEntity Address {get;set;}
}
public class AddressEntity
{
public int Number {get;set}
}
Name属性结合细。但Contact对象内的Address对象的Number属性不绑定。我做错了什么?
我在我的ContactEntity中缺少INotifyPropertyChanged。它在我的ViewModel中,但不在我的实体中。非常感谢 ! – 2011-02-04 15:49:49