0
我有自定義命令ViewModel.DeleteItems。 ViewModel作爲DataContext用於DataGrid。 DeleteItems綁定到上下文菜單並正常工作。綁定CommandBinding到其他命令
我想通過鍵盤「Del」調用這個命令。 我可以使用
<CommandBinding Command="ApplicationCommands.Delete" ... />
,但我想ApplicationCOmmands.Delete命令綁定到我的命令,而不硬編碼(我並不想訂閱的CommandBinding.Executed和手動運行DeleteItems)。如何將應用程序命令綁定到我的自定義命令只有datagrid?