public BoardViewModel() { Issues = new ReactiveList <LocalIssue>(); BoardsInFile = new ReactiveList <BoardInfo>(); RefreshCommand = ReactiveCommand.CreateFromTask(RefreshContent); var isSelectedEditable = this.WhenAnyValue(t => t.SelectedIssue, t => t.SelectedColumn, t => t.SelectedRow, (si, sc, sr) => si != null || sc != null || sr != null); //TODO :add selectcommand when click uneditable with nulling all "selected" fields DeleteCommand = ReactiveCommand.CreateFromTask(DeleteElement, isSelectedEditable); UpdateCardCommand = ReactiveCommand.Create <object>(UpdateCard); UpdateHorizontalHeaderCommand = ReactiveCommand .Create <object>(async ob => await UpdateHorizontalHeader(ob)); UpdateVerticalHeaderCommand = ReactiveCommand .Create <object>(async ob => await UpdateVerticalHeader(ob)); AddNewElementCommand = ReactiveCommand.CreateFromTask <string>(async name => await AddNewElement(name)); IssueSelectCommand = ReactiveCommand.Create <object>(o => { SelectedIssue = o as LocalIssue; if (SelectedIssue == null) { return; } SelectedColumn = null; SelectedRow = null; }); RowHeaderSelectCommand = ReactiveCommand.Create <object>(o => { SelectedRow = scope.GetSelectedRow(o.ToString()); if (SelectedRow == null) { return; } SelectedColumn = null; SelectedIssue = null; }); ColumnHeaderSelectCommand = ReactiveCommand.Create <object>(o => { SelectedColumn = scope.GetSelectedColumn(o.ToString()); if (SelectedColumn == null) { return; } SelectedRow = null; SelectedIssue = null; }); this.WhenAnyValue(bvm => bvm.CurrentBoard) .Where(val => val != null) .Subscribe(async _ => { await RefreshContent(); }); this.WhenAnyValue(w => w.IssueViewModel.IssueChanged) .Where(ch => ch) .Subscribe(async _ => await RefreshContent()); }