我有一个绑定到集合的 SL3 DataGrid。数据网格的一列是 HyperlinkButton 列,我想将该列的单击事件绑定到 VM 中存在的 ICommand。
伪代码:
DataGrid ItemsSource="{Binding someCollection}" DataGridHyperLinkColumn Commands.Command="{Binding myClickCommand}"
现在在这种情况下,Commands.Command 试图在 someCollection 中找到 myClickCommand,而不是从 VM myClickCommand 属性中获取它。
我也尝试过修复 Commands.Command="{Binding Path=DataContext.myClickCommand, ElementName=nameOfUserControl}" 但也失败了。
出路是什么……?我不想使用 BindingHelper,因为 SL3 已经支持 ElementBinding ...