Пример #1
0
        public async Task ExecuteLoadMorePastTripsCommandAsync()
        {
            if (IsBusy || !CanLoadMore)
            {
                return;
            }

            var track = Logger.Instance.TrackTime("LoadMoreTrips");

            track?.Start();
            ProgressDialogManager.LoadProgressDialog("Loading more trips...");

            try
            {
                IsBusy      = true;
                CanLoadMore = true;

                var newCount = Trips.Count + 25;
                Trips.AddRange(await StoreManager.TripStore.GetItemsAsync(Trips.Count, 25, true));

                CanLoadMore = Trips.Count == newCount;
            }
            catch (Exception ex)
            {
                Logger.Instance.Report(ex);
            }
            finally
            {
                track?.Stop();
                IsBusy = false;
                ProgressDialogManager.DisposeProgressDialog();
            }
        }
Пример #2
0
 public TripsContext(DbContextOptions <TripsContext> options) : base(options)
 {
     if (Trips.Any())
     {
         return;
     }
     Trips.AddRange(new List <Trip>
     {
         new Trip {
             Name      = "San Franis college",
             StartDate = new DateTime(2019, 5, 4),
             EndDate   = new DateTime(2019, 5, 7)
         },
         new Trip {
             Name      = "Bithoor Live Meet",
             StartDate = new DateTime(2019, 5, 14),
             EndDate   = new DateTime(2019, 5, 17)
         },
         new Trip {
             Name      = "Local Meetup",
             StartDate = new DateTime(2019, 5, 24),
             EndDate   = new DateTime(2019, 5, 27)
         }
     });
     SaveChanges();
 }