Пример #1
0
        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();
        }
Пример #2
0
 private void AddRecentTrips()
 {
     ShowLoader();
     RecentTrips.Clear();
     RecentTrips.AddRange(UnitOfWork.RecentTripRepository.GetAll().OrderByDescending(x => x.LastUsedDate));
     ShowList();
 }
Пример #3
0
        private void ShowFavourites()
        {
            isFavouritesView = true;

            ClearSearchTextBox();
            RecentTrips.Clear();

            FavouritesVisibility = Visibility.Visible;
            RecentVisibility     = Visibility.Collapsed;

            PageTitleMessage.Send(AppResources.HeaderFavourites);

            AddFavourites();
        }
Пример #4
0
        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;
            }
        }