private async void GoToNextPage(object sender, ExecuteEventArgs args) { int index = this.group.Items.IndexOf(this.viewmodel) + 1; this.viewmodel = this.group.Items[index] as ArticleDataItem; await this.InvokeAndNotifyOnError(this.viewmodel.OnSelectedAsync(this, this.progress)); NotifyAppBarCommands(); }
protected override async Task<IWebViewModel<string>> CreateWebViewModelAsync(NavigationEventArgs e) { ArticleDataItem selected = null; if (NavigationContext.QueryString.ContainsKey("id")) { if (mainDataModel.Articles.Items.Count == 0) await mainDataModel.Articles.OnSelectedAsync(this, this.progress); selected = mainDataModel.GetArticleDataByID(NavigationContext.QueryString["id"]); this.viewmodel = selected; this.group = this.viewmodel.Group as ArticleDataGroup; } return selected; }