public CarPrimitive CreateCar(IModalDialogService modalDialogService, IServiceFactory serviceFactory)
 {
     var viewModel = new UpdateCarViewModel(modalDialogService, serviceFactory);
       viewModel.Car = new CarPrimitive();
       viewModel.DialogMode = DialogMode.Create;
       ModalDialogHelper<UpdateCar>.ShowDialog(viewModel);
       if (!viewModel.IsCanceled)
       {
     return viewModel.Car;
       }
       return null;
 }
 public CarPrimitive EditCar(IModalDialogService modalDialogService, IServiceFactory serviceFactory,
     CarPrimitive selectedCar)
 {
     var viewModel = new UpdateCarViewModel(modalDialogService, serviceFactory);
       viewModel.Car = selectedCar;
       viewModel.DialogMode = DialogMode.Update;
       ModalDialogHelper<UpdateCar>.ShowDialog(viewModel);
       return viewModel.Car;
 }