private async Task OnSearch() { var resultListTask = Task.Run(() => { return(_originalCollection.Where(actor => actor.VoiceActor.Name.ToLowerInvariant().Contains(SearchQuery.ToLowerInvariant())).ToList()); }); var resultList = await resultListTask; FavoritedActors.ReplaceRange(resultList); }
public async Task LoadAsync() { await Task.Run(() => { if (_isUpdatingVoiceActors) { return; } FavoritedActors.ReplaceRange(App.liteDB.GetCollection <FavoritedVoiceActor>().FindAll().ToList()); _originalCollection = new List <FavoritedVoiceActor>(FavoritedActors); }); }