Exemple #1
0
        /// <summary>
        /// Asynchronously executes the task represented by this command.
        /// </summary>
        /// <param name="parameter">Parameter for execution.</param>
        /// <returns></returns>
        public Task ExecuteAsync(object parameter)
        {
            if (!(parameter is TParameter))
            {
                throw new ArgumentException("parameter must match type of Command", nameof(parameter));
            }

            Execution = new NotifyTaskCompletion(this.actionToExecute((TParameter)parameter));
            return(Execution.TaskCompletion);
        }
 /// <summary>
 /// Asynchronously executes the task represented by this command.
 /// </summary>
 /// <param name="parameter">Parameter for execution.</param>
 /// <returns></returns>
 public Task ExecuteAsync(object parameter)
 {
     Execution = new NotifyTaskCompletion(this.actionToExecute());
     return(Execution.TaskCompletion);
 }