Ejemplo n.º 1
0
 public CommandBase(ICanExecuteRequeryStrategy strategy = null)
 {
     this.CanExecuteRequeryStrategy = strategy;
     if (this.CanExecuteRequeryStrategy != null)
     {
         this.CanExecuteRequeryStrategy.RegisterCommand(this);
     }
 }
Ejemplo n.º 2
0
        public DelegateCommand(Action executed, Func <bool> canExecute, ICanExecuteRequeryStrategy strategy = null)
            : base(strategy)
        {
            if (executed == null)
            {
                throw new ArgumentNullException(nameof(executed));
            }

            this._canExecute = canExecute;
            this._executed   = executed;
        }
Ejemplo n.º 3
0
 protected DelegateCommand(ICanExecuteRequeryStrategy strategy)
     : base(strategy)
 {
 }
Ejemplo n.º 4
0
        public AsyncDelegateCommand(Func <T, Task> execute, Func <T, Task <bool> > canExecute, ICanExecuteRequeryStrategy strategy)
            : base(true, strategy)
        {
            if (canExecute == null)
            {
                throw new ArgumentNullException(nameof(canExecute));
            }

            this._execute         = execute;
            this._canExecuteAsync = canExecute;
        }
Ejemplo n.º 5
0
 public AsyncDelegateCommand(Func <T, Task> execute, Func <T, bool> canExecute = null, ICanExecuteRequeryStrategy strategy = null)
     : base(false, strategy)
 {
     this._execute    = execute;
     this._canExecute = canExecute;
     this.IsEnabled   = this._canExecute == null;
 }
Ejemplo n.º 6
0
 public AsyncCommand(bool asyncCanExecute, ICanExecuteRequeryStrategy strategy)
     : base(strategy)
 {
     this.IsEnabled        = false;
     this._asyncCanExecute = asyncCanExecute;
 }