/// <summary> /// Try to get the old articles in the database /// 这是一个可扩展的方法。 /// </summary> private static async Task LoadArticlesFromDb(this FeedViewModel feedViewModel) { if (feedViewModel.Id != null) { feedViewModel.Articles.Clear(); // working here feedViewModel.IsLoading = true; (await SQLiteService.QueryAritclesByFeedIdAsync((int)feedViewModel.Id)).Select(item => new ArticleModel(item)) .ToList().ForEach(article => { article.InitialOnlyBindingProperty(feedViewModel); feedViewModel.Articles.Insert(0, article); // 在这里在开始的时候添加Favourite的文章 if (article.IsStarred) { MainPage.Current.ViewModel.StarredFeed.Articles.Insert(0, article); } }); feedViewModel.IsLoading = false; } return; }