public ShellViewModel() { var canExecute = this.WhenAnyValue(vm => vm.EnteredText) .Select(s => !string.IsNullOrWhiteSpace(s)); Child = new ChildViewModel(); OKCmd = ReactiveCommand.Create(canExecute); OKCmd.Subscribe(_ => Child.Name = "You entered " + EnteredText); }
public HomeViewModel() { //Define conditions var okCmdObs = this.WhenAny(vm => vm.EnteredText, s => !string.IsNullOrWhiteSpace(s.Value)); //Create conditions OKCmd = ReactiveCommand.Create(okCmdObs); //Update Status OKCmd.Subscribe(_ => Status = EnteredText + " is saved."); }