title: How to implement INotifyPropertyChanged in Xamarin.Forms
body: <p>I am implementing a cart in Xamarin.Forms. In my cart page there is a <code>ListView</code> with data. Each of the cell contains a button to select the count of <em>item</em> and <em>amount</em>. In the cart view there is a grand total label.</p>
  
  <p>My problem is the grand total is not updating while the number picker changes. The calculation method is called upon item adding view cell. I know that i need to implement <code>INotifyProperty</code> for this, but I'm unsure of how to do it.</p>
  
  <p>I have a base view model which inherits <code>INotifyProperty</code> that contains an event.</p>
  
  <pre><code> public class BaseViewModel : INotifyPropertyChanged
  {
      private double  _price;
      public double Price
      {
          get 
          { 
              return _price; 
          }
          set 
          { 
              _price = value;
              OnPropertyChanged("Price");}
          } 
  
   protected virtual void OnPropertyChanged(string propertyName)
   {
       if (PropertyChanged != null)
       {
           PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
       }
   }
  </code></pre>
  
  <p><strong>View model</strong></p>
  
  <pre><code>    public BaseViewModel()
      {
          App.Instance.ViewModel = this;
          TempList = TempList ?? new ObservableCollection&lt;cm_items&gt;();
          this.Title = AppResources.AppResource.Cart_menu_title;
          this.Price = CartCell.price;
      }
  </code></pre>