I have an items control which has items on a canvas, when I press delete I want to delete an item from the canvas:
<ItemsControl.InputBindings>
<KeyBinding Command="{Binding DeleteItemCommand}" Key="Delete"/>
</ItemsControl.InputBindings>
However, the method in DeleteItemCommand is never called.
How can I achieve this?
The ItemsControl
(or possibly something within) needs to be Focusable
to receive keyboard input.