Esempio n. 1
0
        protected virtual bool ExecuteCommand(ExecuteReason reason)
        {
            // 简单检查当前状态
            if (!this.IsKeyboardFocusWithin)
            {
                return(false);
            }
            if (Command == null)
            {
                return(false);
            }

            // 已经结束的情况下,自动停止定时器
            if (reason >= ExecuteReason.CanLostFocus)
            {
                StartAutoCommitTimer(0);
            }

            // 执行命令
            Command.Execute(new ExecuteParameter(this, CommandParameter, reason));

            return(true);
        }
Esempio n. 2
0
 public ExecuteParameter(CommandComboBox source, object parameter, ExecuteReason reason)
 {
     this.Source           = source;
     this.CommandParameter = parameter;
     this.Reason           = reason;
 }
Esempio n. 3
0
 public ExecuteRoutedEventArgs(ExecuteReason reason)
 {
     Reason = reason;
 }