CanExecute() public méthode

public CanExecute ( object parameter ) : bool
parameter object
Résultat bool
 public void RelayCommand_CanExecute_WhenConstructedWithoutAPredicate_ReturnsTrueAsADefault()
 {
     //------------Setup for test--------------------------
     var relayCommand = new RelayCommand(o => { });
     //------------Execute Test---------------------------
     var canExecute = relayCommand.CanExecute(null);
     //------------Assert Results-------------------------
     Assert.IsTrue(canExecute);
 }
 public void RelayCommand_CanExecute_WhenConstructedWithAPredicate_PredicateIsCalled()
 {
     //------------Setup for test--------------------------
     var canExecuteWasCalled = false;
     var relayCommand = new RelayCommand(o => { }, o =>
     {
         canExecuteWasCalled = true;
         return true;
     });
     //------------Execute Test---------------------------
     var canExecute = relayCommand.CanExecute(null);
     //------------Assert Results-------------------------
     Assert.IsTrue(canExecuteWasCalled);
     Assert.IsTrue(canExecute);
 }