multi key gesture in wpf

前端 未结 4 1624
独厮守ぢ
独厮守ぢ 2020-12-21 05:55

I have a RoutedUICommand called Comment Selection. I need to add an input gesture for this command as it is in VIsual Studio, ie. (Ctrl+K

4条回答
  •  孤城傲影
    2020-12-21 06:09

    
    get
    
        {
    
            if (exitCommand == null)
    
            {
    
                exitCommand = new DelegateCommand(Exit);
    
                exitCommand.GestureKey = Key.X;
    
                exitCommand.GestureModifier = ModifierKeys.Control;
    
                exitCommand.MouseGesture = MouseAction.LeftDoubleClick;
    
            }
    
            return exitCommand;
    
        }
    
    }
     private void Exit()
    {
        Application.Current.Shutdown();
    }
    

提交回复
热议问题