//default constructor public cartViewModel() { service = new productService(); totalList = service.getAllProducts(); addedList = new ObservableCollection <product>(); addCommand = new DelegateCommand(add, canAdd); finishCommand = new DelegateCommand(finish, canFinish); }
//default constructor public adminMainViewModel() { service = new productService(); //storing all products in list list = service.getAllProducts(); //initializing all commands addProductCommand = new DelegateCommand(add, canAdd); showProductCommand = new DelegateCommand(display, canDisplay); deleteProductCommand = new DelegateCommand(delete, canDelete); }