private async void OpenTrip(Trip trip)
 {
     try
     {
         await Navigator.PushAsync<ItinerariesViewModel>(vm => vm.Trip = trip);
     }
     catch (Exception ex)
     {
         ReportError(ex);
     }
 }
 private async void DeleteTrip(Trip trip)
 {
     try
     {
         await DataStore.RemoveTrip(trip);
         Trips.Remove(trip);
     }
     catch (Exception ex)
     {
         ReportError(ex);
     }
 }
        protected override void Done()
        {
            if (_end <= _start)
            {
                ReportMessage("Start must precede End", "Time travel is not supported");
                return;
            }

            Result = ModalResult.Done;

            _trip = new Trip
            {
                Name = _name,
                Start = _start,
                End = _end
            };

            Navigator.PopModalAsync();
        }
Example #4
0
 public Task UpdateTrip(Trip trip)
 {
     return Connection.UpdateAsync(trip);
 }
Example #5
0
 public Task RemoveTrip(Trip trip)
 {
     return Connection.DeleteAsync(trip);
 }
Example #6
0
 public async Task<IList<Itinerary>> GetItineraries(Trip trip)
 {
     return await Connection.Table<Itinerary>().Where(i => i.TripID == trip.ID).ToListAsync().ConfigureAwait(false);
 }
Example #7
0
 public Task AddTrip(Trip trip)
 {
     return Connection.InsertAsync(trip);
 }