private async Task DeleteVehicle() { await _vehicleSpecificationCrudService.Delete(_vehicle.VehicleSpecification.Id); await _vehicleCrudService.Delete(_vehicle.Vin); VehicleRemoved?.Invoke(this, EventArgs.Empty); }
public async void Remove(VehicleViewModel v) { Busy = true; var vehicle = await Services.Host.VehicleService.RemoveVehicle(v.Id); if (vehicle == null) { VehicleNotRemoved?.Invoke(this, v.Registration + " was not removed." + Environment.NewLine + "This is most likely because the vehicle was used for a journey."); } else { VehicleRemoved?.Invoke(this, vehicle.Registration + " was removed."); } Busy = false; Refresh(); }