public void Execute(T2 parameter) { if (executeMethod != null) { executeMethod(parameter); } //now raise CommandCompleted for this ICommand WeakActionEvent <object> completedHandler = CommandCompleted; if (completedHandler != null) { completedHandler.Invoke(parameter); } }
public SimpleCommand(Action <T2> executeMethod) { _executeMethod = executeMethod; _canExecuteMethod = x => { return(true); }; CommandCompleted = new WeakActionEvent <object>(); }
public CommandHandler(Action <T2> executeMethod) { this.executeMethod = executeMethod; this.canExecuteMethod = (x) => { return(true); }; this.CommandCompleted = new WeakActionEvent <object>(); }
public SimpleCommand(Func <T1, bool> canExecuteMethod, Action <T2> executeMethod) { _executeMethod = executeMethod; _canExecuteMethod = canExecuteMethod; CommandCompleted = new WeakActionEvent <object>(); }
public CommandHandler(Func <T1, bool> canExecuteMethod, Action <T2> executeMethod) { this.executeMethod = executeMethod; this.canExecuteMethod = canExecuteMethod; this.CommandCompleted = new WeakActionEvent <object>(); }