【发布时间】:2011-02-04 14:58:53
【问题描述】:
我在 WPF 中有一个带有 2 个文本框的表单:
<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 属性没有绑定。我做错了什么?
【问题讨论】: