コード例 #1
0
        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);
        }
コード例 #2
0
 public void GetHistory(IReadOnlyRepository <VehicleHistoryAdapter> readRepository)
 {
     vehicleHistory = readRepository.Find(id);
 }