Мне нужно создать привязку ввода для окна.
public class MainWindow : Window
{
public MainWindow()
{
SomeCommand = ??? () => OnAction();
}
public ICommand SomeCommand { get; private set; }
public void OnAction()
{
SomeControl.DoSomething();
}
}
<Window>
<Window.InputBindings>
<KeyBinding Command="{Binding SomeCommand}" Key="F5"></KeyBinding>
</Window.InputBindings>
</Window>
Если я запустил SomeCommand с некоторым CustomCommand: ICommand, он не срабатывает. Свойство someCommand get() никогда не вызывается.