我有一个WPF表单,其中包含2个文本框:
<TextBox Name="txtName" Text="{Binding Contact.Name}"/>
<TextBox Name="txtAddressNumber" Text="{Binding Contact.Address.Number}"/>
我有两个类:
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属性没有绑定。我做错了什么?