private async Task LoadVehicleHistory() { var vehicles = (await MainViewModel.GetVehicleHistory()).OrderByDescending(v => v.LastSelected); // specify an adapter var adapter = new VehicleHistoryAdapter(vehicles); adapter.ItemClick += (s1, arg1) => { LaunchMileageActivity(arg1.ViewModel); }; adapter.DeleteRequest += (s1, arg1) => { DeleteVehicle(arg1.ViewModel); }; adapter.MileageRequest += (s1, arg1) => { LaunchMileageActivity(arg1.ViewModel); }; adapter.DiagnosticRequest += (s1, arg1) => { LaunchDiagnosticActivity(arg1.ViewModel); }; VehicleRecyclerView.SetAdapter(adapter); }
public void GetHistory(IReadOnlyRepository <VehicleHistoryAdapter> readRepository) { vehicleHistory = readRepository.Find(id); }