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