示例#1
0
 public void Execute(object parameter)
 {
     if (Action != null)
     {
         Action();
     }
     if (Click != null)
     {
         Click(this, EventArgs.Empty);
     }
     if (InternalCommand != null && InternalCommand.CanExecute(parameter))
     {
         InternalCommand.Execute(parameter);
     }
 }
示例#2
0
 private void InternalExecuteCommand()
 {
     if (Command != null)
     {
         if (Command.CanExecute(CommandParameter))
         {
             Command.Execute(CommandParameter);
             InternalCommand?.Execute(null);
         }
     }
     else
     {
         InternalCommand?.Execute(null);
     }
 }