using System; using System.Collections.Generic; using System.Threading.Tasks; using AutoCat.Utils; using AutoCatCore.Model; using AutoCatCore.Services.Storage; namespace AutoCat.ViewModels; public class HistoryViewModel(IStorageService storageService) : ViewModelBase { public IEnumerable Vehicles { get; } = storageService.AllVehicles; public async Task AddVehicle(Vehicle vehicle) { try { await storageService.AddVehicle(vehicle); } catch (Exception ex) { Alerts.ShowError(ex); } } }