Hello everyone,

I have a class holding information, which implements INotifyPropertyChanged. Everything works fine so far, everything gets updated when a change is made.

But my problem starts with this piece of code:

csharp Code:
  1. //List of TransActionProduct -- This is the class I mentioned
  2. ObservableCollection<Transactions.TransactionProduct> _PackageProducts = new ObservableCollection<SuperMarket.Data.Transactions.TransactionProduct>();
  3.  
  4. //This property adds up all the prices in the _PackageProducts List and returns it
  5.         decimal _price;
  6.         public decimal Price
  7.         {
  8.             get
  9.             {
  10.                 for (int i = 0; i < PackageProducts.Count; i++)
  11.                 {
  12.                     _price = _price + PackageProducts[i].TransactionProductPrice;
  13.                 }                
  14.                 return _price;
  15.                
  16.             }
  17.             set
  18.             {
  19.  
  20.                 _price = value;
  21.  
  22.                 //This class also implements INotifyPropertyChanged        
  23.                 NotifiyChange("Price");    
  24.             }
  25.            
  26.         }

The problem is that while changing the prices of the TransactionProduct the Price property from the class above doesn't get updated.

Does anyone know how can I make that property update while the TransactionProduct's price changes ?