private async Task Setup() { await analyzeService.CacheAllTalk(); foreach (var userName in analyzeService.AllTalkDictionary.Keys) { ListBoxUser.Items.Add(userName); } var totalWord = new List <Word>(); foreach (var item in analyzeService.AllTalkDictionary) { totalWord.AddRange(item.Value); } var enumerable = totalWord.GroupBy(w => w.Base).Select(x => new { RealName = x.Key, Count = x.Count() }) .Where(x => x.Count > 1) .OrderByDescending(x => x.Count); foreach (var item in enumerable) { WordViewModels.Add(new WordViewModel { Base = item.RealName, Count = item.Count }); } ListBoxWord.ItemsSource = WordViewModels; }
public async Task CacheAllTalk() { var service = new AnalyzeService(); await service.CacheAllTalk(); }