【发布时间】:2011-02-15 18:33:10
【问题描述】:
伪代码示例:
<UserControl>
<ComboBox SelectedValuePath="Id" SelectedValue="{Binding CurrentObject.Id, Mode=TwoWay}" ItemSource="{Binding Groups}"/>
<ComboBox SelectedValuePath="Name" SelectedValue="{Binding CurrentObject.Status, Mode=TwoWay}" ItemSource="{Binding Statuses}"/>
</UserControl>
我将<MyObject> 类型的对象传递给此用户控件,对其进行修改然后保存。完成此操作后,我将使用CurrentObject = null 重置状态。在第二遍中,这些组合框没有选定的值,尽管有实际数据。我该如何解决?
【问题讨论】: