AttachedCommandBehavior.CommandExecutionStrategy.Execute C# (CSharp) Method

Execute() public method

Executes the Command that is stored in the CommandProperty of the CommandExecution
public Execute ( object parameter ) : void
parameter object The parameter for the command
return void
        public void Execute(object parameter)
        {
            if (Behavior == null) {
                throw new InvalidOperationException("Behavior property cannot be null when executing a strategy");
            }

            if (Behavior.Command.CanExecute(Behavior.CommandParameter)) {
                Behavior.Command.Execute(Behavior.CommandParameter);
            }
        }
CommandExecutionStrategy