public virtual void Execute(object parameter) { UICommandExecutingEventArgs args = new UICommandExecutingEventArgs(parameter); this.OnExecuting(args); if (!this.Handled) { parameter = args.Parameter; if (this.action != null) this.action(); if (this.actionWithParameter != null) this.actionWithParameter(parameter); this.OnExecuted(parameter); } else this.Handled = false; }
protected void OnExecuting(UICommandExecutingEventArgs args) { EventHandler<UICommandExecutingEventArgs> handler = this.Executing; if (handler != null) { handler(this, args); } }