public static CarAndDriverPackage GetPackageCopy(this CarAndDriverPackage source)
 {
     CarAndDriverPackage package = new CarAndDriverPackage();
       package.Driver = source.Driver.GetPrimitiveCopy();
       package.Car = source.Car.GetPrimitiveCopy();
       return package;
 }
        public static CarAndDriverPackage GetCarAndDriverPackage(this Car car)
        {
            CarAndDriverPackage result = new CarAndDriverPackage();

              if (car != null)
              {
            result.Car = car.GetPrimitive();
            if (car.Driver != null)
            {
              result.Driver = car.Driver.GetPrimitive();
            }
              }
              return result;
        }
 public CarAndDriverPackage EditDriver(IModalDialogService modalDialogService, IServiceFactory serviceFactory,
     CarAndDriverPackage selectedCarAndDriver)
 {
     var viewModel = new UpdateDriverViewModel(modalDialogService, serviceFactory);
       viewModel.CarAndDriver = selectedCarAndDriver;
       viewModel.DialogMode = DialogMode.Update;
       ModalDialogHelper<UpdateDriver>.ShowDialog(viewModel);
       return viewModel.CarAndDriver;
 }