Пример #1
0
        public MainWindowViewModel()
        {
            CurrentCell = Observable.Merge(
                SetCurrentCellCommand
                .Select(_ => new CellViewModel {
                IsFirstFlag = (!CurrentCell.Value?.IsFirstFlag) ?? false
            }),
                ClearCurrentCellCommand
                .Select(_ => default(CellViewModel))
                ).ToReadOnlyReactiveProperty();

            TestCommand = CurrentCell.Select(x => x?.IsFirstFlag ?? false)
                          .ToReactiveCommand()
                          .WithSubscribe(() => Debug.WriteLine(CurrentCell.Value.IsFirstFlag));
        }