I'd like to bind multiple keys to one command like this:
SwitchViewCommand.InputGestures.Add(new KeyGesture(Key.F7));
SwitchViewCommand.InputGestures.Add(new KeyGesture(Key.F8));
next in the event handler I'd like to switch views based on the key that was pressed:
private void SwitchViewCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{
// if F7 then do something, if F8 then do something else
}
but I cannot find a way to determine the key. I checked the event args in the debugger but I did not see anything useful. Is it at all possible or do I need to create a separate command for each case?