예제 #1
0
        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
                });
            }
        }
예제 #2
0
 public void AddItem(TransactionItemViewModel item)
 {
     UpdateQuantity(item, 1);
 }
예제 #3
0
 public void RemoveItem(TransactionItemViewModel item)
 {
     UpdateQuantity(item, -1);
 }
예제 #4
0
        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 });
        }
예제 #5
0
 public void RemoveItem(TransactionItemViewModel item)
 {
     UpdateQuantity(item, -1);
 }
예제 #6
0
 public void AddItem(TransactionItemViewModel item)
 {
     UpdateQuantity(item, 1);
 }