private void TimerTickSearch(object sender, EventArgs e) { timerSearch.Stop(); ShowHeaderLoader(); if (isFavouritesView) { IEnumerable <Favourite> favourites = UnitOfWork.FavouriteRepository.GetByName(searchText); Favourites.Clear(); Favourites.AddRange(favourites); } else { IEnumerable <Recent> recentTrips = UnitOfWork.RecentTripRepository.GetByName(searchText); RecentTrips.Clear(); RecentTrips.AddRange(recentTrips); } HideHeaderLoader(); ShowList(); }
private void AddRecentTrips() { ShowLoader(); RecentTrips.Clear(); RecentTrips.AddRange(UnitOfWork.RecentTripRepository.GetAll().OrderByDescending(x => x.LastUsedDate)); ShowList(); }
private void ShowFavourites() { isFavouritesView = true; ClearSearchTextBox(); RecentTrips.Clear(); FavouritesVisibility = Visibility.Visible; RecentVisibility = Visibility.Collapsed; PageTitleMessage.Send(AppResources.HeaderFavourites); AddFavourites(); }
private void ShowRecentTrips() { HideSearchList(); RecentTrips.Clear(); RecentTrips.AddRange(UnitOfWork.RecentTripRepository.GetAll()); RecentRowVisibility = Visibility.Visible; if (this.RecentTrips.Count == 0) { RecentTripsListVisibility = Visibility.Collapsed; NoRecentsVisibility = Visibility.Visible; } else { RecentTripsListVisibility = Visibility.Visible; NoRecentsVisibility = Visibility.Collapsed; } }