private async void LoadFavStations() { //await Task.Delay(2000); //Task.Run(async () => //{ var favList = await _favStationService.GetMyStationsAsync(); SetFavStations(favList); Trajecten = new ObservableCollection <Traject>(await _trajectService.GetAll()); SearchHistory = new ObservableCollection <PlannerSearch>(await _searchHistoryService.GetListFromStoreAsync()); // }); }
private async void SetIsFav() { Traject t = new Traject() { From = this.CurrentSearch.VanStation, To = this.CurrentSearch.NaarStation, Via = this.CurrentSearch.ViaStation }; var list = await _trajectService.GetAll(); var found = list.Where(x => x.UniqueId == t.UniqueId).FirstOrDefault(); IsFav = (found != null); }