Beispiel #1
0
        public MainWindowModel()
        {
            TitleBar = new TitleBarViewModel();

            ServerResult = "Haven't talked to the server yet...";

            var firstAndLastFilled = this.WhenAnyValue(vm => vm.FirstName, vm => vm.LastName,
                (f, l) => !string.IsNullOrWhiteSpace(f) && !string.IsNullOrWhiteSpace(l));

            ChangeName = ReactiveCommand.CreateAsyncTask(firstAndLastFilled, _ => PretendToCallTheServer());
            ChangeName.Subscribe(r => ServerResult = r);
        }
        public MainWindowModel()
        {
            TitleBar = new TitleBarViewModel();

            ServerResult = "Haven't talked to the server yet...";

            var firstAndLastFilled = this.WhenAnyValue(vm => vm.FirstName, vm => vm.LastName,
                                                       (f, l) => !string.IsNullOrWhiteSpace(f) && !string.IsNullOrWhiteSpace(l));

            ChangeName = ReactiveCommand.CreateAsyncTask(firstAndLastFilled, _ => PretendToCallTheServer());
            ChangeName.Subscribe(r => ServerResult = r);
        }