我希望在单击DataGrid项时在我的ViewModel中执行一个命令.作为参数,我希望有相应的行.
我在互联网上找到了一种方法,但它使用了 DependencyProperty
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/632ea875-a5b8-4d47-85b3-b30f28e0b827
我没有DependencyProperty在我的项目中使用,而是我正在使用INotifyPropertyChanged.如何实现"双击数据网格"commaind而不使用DependencyProperty?
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
...
<DataGrid SelectedItem={Binding MySelectedItem, Mode=TwoWay}>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction Command="{Binding YourCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</DataGrid>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7757 次 |
| 最近记录: |