public VMAttManagement() { _bll = new BLLAttManagement(); this.ItemsSource = new ObservableCollection<SKUATTModel>(); this.ItemsSource.CollectionChanged += (s, e) => { (this.CmdDel as DelegateCommand).RaiseCanExecuteChanged(); }; ApplicationContext.EventAggregator.GetEvent<OneChangedEvent>().Subscribe(OneChangedEventExecute, ThreadOption.UIThread); ApplicationContext.EventAggregator.GetEvent<TwoChangedEvent>().Subscribe(TwoChangedEventExecute, ThreadOption.UIThread); this.InitCommands(); this.InitData(); }
public VMAddOrUpdateATT(SKUATTModel model,short attTypeID, Guid skucid) { _isAdd = model == null; if (_isAdd) { _model = new SKUATTModel() { SKUCID = skucid, ATTType = attTypeID, }; } else { _model = new SKUATTModel(model.Entity); } this.CmdSave = new DelegateCommand(this.CmdSaveExecute); _bll = new BLLAttManagement(); }