假设我有一个包含这两个不朽表的数据集:Employee & Order
Emp -> ID, Name
Ord -> Something, Anotherthing, EmpID
和关系Rel : Ord (EmpID) -> Emp (ID)
它在标准的主/细节场景中效果很好
(显示员工、跟踪关系、显示相关订单),
但是当我不想走相反的路(显示带有 Emp.Name 的 Ord 表)时怎么办?
像这样的东西:
<stackpanel> // with datacontext set from code to dataset.tables["ord"]
<TextBox Text="{Binding Something}"/>
<TextBox Text="{Binding Anotherthing}"/>
<TextBox Text="{Binding ???}"/> // that's my problem, how to show related Emp.Name
</stackpanel>
有任何想法吗?我可以创建值转换器,但如果我不想使用从父模块获得的数据集实例,它就会变得棘手。