protected void UpdateQuantity(TransactionItemViewModel item, int value) { var canComplete = CanCompleteLoan; item.Quantity += value; NotifyOfPropertyChange(() => CanCompleteLoan); NotifyOfPropertyChange(() => Total); NotifyOfPropertyChange(() => TotalText); if (!canComplete && CanCompleteLoan) { EventAggregator.Publish(new TransactionStarted { Source = this }); } if (canComplete && !CanCompleteLoan) { EventAggregator.Publish(new TransactionStopped { Source = this }); } }
public void AddItem(TransactionItemViewModel item) { UpdateQuantity(item, 1); }
public void RemoveItem(TransactionItemViewModel item) { UpdateQuantity(item, -1); }
protected void UpdateQuantity(TransactionItemViewModel item, int value) { var canComplete = CanCompleteLoan; item.Quantity += value; NotifyOfPropertyChange(() => CanCompleteLoan); NotifyOfPropertyChange(() => Total); NotifyOfPropertyChange(() => TotalText); if (!canComplete && CanCompleteLoan) EventAggregator.Publish(new TransactionStarted { Source = this }); if (canComplete && !CanCompleteLoan) EventAggregator.Publish(new TransactionStopped { Source = this }); }