Exemplo n.º 1
0
        /// <summary>
        /// Creates a new command.
        /// </summary>
        /// <param name="execute">The execution logic.</param>
        /// <param name="canExecute">The execution status logic.</param>
        public RelayCommand(ExecFuncDelegate execute, CanExecFuncDelegate canExecute)
        {
            if (execute == null)
            {
                throw new ArgumentNullException(nameof(execute));
            }

            _execute    = execute;
            _canExecute = canExecute;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of <see>
 ///         <cref>DelegateCommand{T}</cref>
 ///     </see>
 ///     .
 /// </summary>
 /// <param name="execute">Delegate to execute when Execute is called on the command.  This can be null to just hook up a CanExecute delegate.</param>
 /// <remarks><seealso cref="CanExecute"/> will always return true.</remarks>
 public RelayCommand(ExecFuncDelegate execute)
     : this(execute, null)
 {
 }