0

I am using button in one of my wpf window. I am binding my custom routed UI command to the button.

public static readonly RoutedUICommand DeleteRow = new RoutedUICommand("Delete Row", "Delete Row", typeof(TestDataView));

I want to assign Delete key as a short-cut. How can I achieve it? Please guide me. Do let me know if you need any other information about this question.

Regards, Priyank

Priyank Thakkar
  • 4,532
  • 17
  • 52
  • 90

1 Answers1

4

Use this:

 DeleteRow.InputGestures.Add(new KeyGesture(Key.Delete));
ionden
  • 12,216
  • 1
  • 43
  • 37