Beispiel #1
0
        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;
        }
Beispiel #2
0
 protected void OnExecuting(UICommandExecutingEventArgs args)
 {
     EventHandler<UICommandExecutingEventArgs> handler = this.Executing;
     if (handler != null)
     {
         handler(this, args);
     }
 }