我有这个 xaml:
<DataGrid.InputBindings>
<KeyBinding Key="a" Command="{Binding Path=Function}" CommandParameter="{Binding ElementName=dataGrid1,Path=SelectedItem}"></KeyBinding>
<KeyBinding Key="s" Command="{Binding Path=Function}" CommandParameter="{Binding ElementName=dataGrid1,Path=SelectedItem}"></KeyBinding>
</DataGrid.InputBindings>
当我选择一行并按 a 或 si 时,将所选项目绑定到 KeyPressed。我的问题是我怎么知道我按下了哪个键?(我想绑定按键和选定的项目)