private async Task RefreshContent() { Issues.Clear(); VerticalDimension = null; VerticalDimension = await scope.GetRowHeadersAsync(CurrentBoard.Id); HorizontalDimension = null; HorizontalDimension = await scope.GetColumnHeadersAsync(CurrentBoard.Id); CardContent = scope.GetCardContent(); Issues.PublishCollection(await scope.GetIssuesByBoardIdAsync(CurrentBoard.Id)); }
} //TODO: add some logic preventing empty name public void Initialize(ViewRequest viewRequest) { var request = viewRequest as BoardViewRequest; IssueViewModel = new IssueViewModel(); scope = request.Scope; Observable.FromAsync(() => scope.GetAllBoardsInFileAsync()) .ObserveOnDispatcher() .Subscribe(boards => { BoardsInFile.PublishCollection(boards); CurrentBoard = !string.IsNullOrEmpty(request.SelectedBoardName) ? BoardsInFile.First(board => board.Name == request.SelectedBoardName) : BoardsInFile.First(); Issues.Clear(); Observable.FromAsync(() => scope.GetRowHeadersAsync(CurrentBoard.Id)) .ObserveOnDispatcher() .Subscribe(vert => VerticalDimension = vert); Observable.FromAsync(() => scope.GetColumnHeadersAsync(CurrentBoard.Id)) .ObserveOnDispatcher() .Subscribe(horiz => HorizontalDimension = horiz); CardContent = scope.GetCardContent(); Observable.FromAsync(() => scope.GetIssuesByBoardIdAsync(CurrentBoard.Id)) .ObserveOnDispatcher() .Subscribe(issues => Issues.AddRange(issues)); }); }