Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 Silverlight,我有一个绑定到表 A 的数据表单,我需要用表 B 中的数据填充此数据表单的组合框。如何在 XAML 代码中声明它?
例如,如果您的数据表单位于具有名为“TableBItems”的属性的 UserControl 中,您可以编写:
<ComboBox SelectedItem={Binding FieldInTableA,Mode=TwoWay} ItemsSource={Binding TableBItems, RelativeSource={RelativeSource AncestorType='UserControl'}} DisplayMemberPath="FieldInTableBYouWantToShow"/>