This question gives a clean method for binding a key at the window level to a ViewModel command in XAML. This is pretty fantastic, but it doesn't allow for customization of the key being used. Is it possible to bind the "key" value to the viewmodel, and if so, what type of value is a "key" in csharp?
<Window.InputBindings>
<KeyBinding Key="{Binding RefreshKey}"
Command="{Binding RefreshCommand}" />
Or is it possible to add window-level keybindings in the code? The same question has a solution for putting it in the code-behind, but I would prefer to keep the code in the ViewModel if its possible.