0
單個RoutedUICommand
是否可以有兩個或更多個KeyGestures
?單個RoutedUICommand的多個KeyGestures
例如:用戶希望能夠按空間或Alt + P鍵播放視頻。
目前,如果我將KeyGestures
設置爲RoutedUICommand
,則預計它們都將被按下執行。
private static RoutedUICommand _play = new RoutedUICommand("Play", "Play", typeof(Commands),
new InputGestureCollection
{
new KeyGesture(Key.P, ModifierKeys.Alt, "Alt + P"),
new KeyGesture(Key.Space, ModifierKeys.None, "Space")
});
所以,我可以設置多個KeyGestures
到一個RoutedUICommand
?如果是這樣,怎麼樣?
大。我可以將'KeyBindings'直接註冊到'RoutedUICommand'嗎? –
是的,我相信。我還沒有嘗試過。 –