【发布时间】:2012-07-05 12:39:48
【问题描述】:
在 WPF 4 UserControl 中,我可以在 XAML 中定义子控件的绑定,如下所示...
...
<ComboBox
ItemsSource="{Binding CBItems,
RelativeSource={RelativeSource AncestorType=UserControl}}"
...
/>
...
其中 CBItems 是在 UserControl 后面的代码中定义的属性。
但是这种格式在 Windows 8 Metro 中不可用 - RelativeSource 没有成员 AncestorType。
如何在 Windows 8 中进行这种类型的绑定?
【问题讨论】: