private async Task OnNewSourceLangRequested(LangResultViewModel sender)
 {
     ResultsVM.ReplaceTargetLang(sender.Lang, SearchVM.SourceLang);
     SearchVM.SourceLang = sender.ToLanguage();
     ResetSearchState();
     await PersistState();
 }
Exemple #2
0
 public void ApplySearchResults(SearchResults searchResults)
 {
     SearchResults = TargetLangs
                     .Select(l =>
     {
         var result = searchResults.LangLinks?.FirstOrDefault(sr => sr.Lang == l.Id);
         return(result == null
                 ? LangResultViewModel.FromLanguage(l)
                 : LangResultViewModel.FromLangSearchResult(result));
     })
                     .ToArray();
 }