public virtual bool CanExecute(object parameter)
        {
            bool hasEnabledCommandsThatShouldBeExecuted = false;

            ICommand[] commandList;
            lock (this.registeredCommands)
            {
                commandList = this.registeredCommands.ToArray();
            }
            foreach (ICommand command in commandList)
            {
                if (this.ShouldExecute(command))
                {
                    if (!command.CanExecute(parameter))
                    {
                        return false;
                    }

                    hasEnabledCommandsThatShouldBeExecuted = true;
                }
            }

            return hasEnabledCommandsThatShouldBeExecuted;
        }

相关文章:

  • 2022-02-09
  • 2021-10-15
  • 2021-05-30
  • 2021-08-05
  • 2022-12-23
  • 2021-11-23
  • 2021-07-22
  • 2021-10-11
猜你喜欢
  • 2021-05-18
  • 2021-07-24
  • 2022-12-23
  • 2021-11-06
  • 2021-08-07
  • 2021-12-10
相关资源
相似解决方案