// note that this viewmodel is instantiated on-demand from parent and not with DI public EditOrderDetailViewModel(IServiceFactory serviceFactory, OrderDetail orderDetail) { _serviceFactory = serviceFactory; _orderDetail = new OrderDetail() { Id = orderDetail.Id, Notes = orderDetail.Notes, Count = orderDetail.Count, //ToDo Part = OrderId = orderDetail.OrderId, Price = orderDetail.Price }; _orderDetail.CleanAll(); LoadParts(); SaveCommand = new DelegateCommand <object>(OnSaveCommandExecute, OnSaveCommandCanExecute); CancelCommand = new DelegateCommand <object>(OnCancelCommandExecute); }
// note that this viewmodel is instantiated on-demand from parent and not with DI public EditOrderDetailViewModel(IServiceFactory serviceFactory, OrderDetail orderDetail) { _serviceFactory = serviceFactory; _orderDetail = new OrderDetail() { Id = orderDetail.Id, Notes = orderDetail.Notes, Count = orderDetail.Count, //ToDo Part = OrderId = orderDetail.OrderId, Price = orderDetail.Price }; _orderDetail.CleanAll(); LoadParts(); SaveCommand = new DelegateCommand<object>(OnSaveCommandExecute, OnSaveCommandCanExecute); CancelCommand = new DelegateCommand<object>(OnCancelCommandExecute); }