【发布时间】:2020-06-20 11:42:24
【问题描述】:
<DataTemplate>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Key}"></TextBlock>
<ComboBox ItemsSource="{Binding Value}" SelectedItem="{Binging SomeProperty}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
我在 Dictionary 内部,我想绑定 SelectedItem="{Binging SomeProperty}" SomeProperty 是 ViweModel 的属性,而不是 Dictionary 内部。怎么做?如何绑定到当前绑定上下文之外的属性。
【问题讨论】:
标签: c# wpf caliburn.micro