예제 #1
0
        // note that this viewmodel is instantiated on-demand from parent and not with DI
        public EditCarViewModel(IServiceFactory serviceFactory, Car car)
        {
            _ServiceFactory = serviceFactory;
            _Car = new Car()
            {
                CarId = car.CarId,
                Description = car.Description,
                Color = car.Color,
                Year = car.Year,
                RentalPrice = car.RentalPrice
            };

            _Car.CleanAll();

            SaveCommand = new DelegateCommand<object>(OnSaveCommandExecute, OnSaveCommandCanExecute);
            CancelCommand = new DelegateCommand<object>(OnCancelCommandExecute);
        }