title: INotifyPropertyChanged for Count property in WPF?
body: <p>I have a textbox which is bound to an <code>Int</code> property in my viewmodel which gets a count of an <code>ObservableCollection</code>. Here is my Xaml binding:</p>
  
  <pre><code>Text="{Binding ArticleCount, Mode=OneWay}" 
  </code></pre>
  
  <p>And my int property:</p>
  
  <pre><code> private Int32 _ArticleCount;
      public int ArticleCount
      {
          get
          {                
              if (this.ModelviewArticleObservableList == null)
              {
                  return 0;
              }
              else
              {
                  return this.ModelviewArticleObservableList.Count;                  
              }               
          } 
      }
  </code></pre>
  
  <p>This works fine on application initialisation and I get the <code>ObservableCollection</code> count in my UI <code>TextBox</code>. However there are methods that then change the <code>ObservableCollection</code> and therefore the count changes. I need a Property Changed event to notify the when the count has changed but I'm not sure on how to do this? Here is my <code>ObservableCollection</code> property:</p>
  
  <pre><code> private ObservableCollection&lt;viewArticle&gt; _ModelviewArticleObservableList = new ObservableCollection&lt;viewArticle&gt;();
      public ObservableCollection&lt;viewArticle&gt; ModelviewArticleObservableList
      {
          get { return _ModelviewArticleObservableList; }
          set
          {
              _ModelviewArticleObservableList = value;
              OnPropertyChanged("ModelviewArticleObservableList");                
          }
      }
  </code></pre>
  
  <p>I currently have a normal implementation of INPC:</p>
  
  <pre><code>public event PropertyChangedEventHandler PropertyChanged;
      public void OnPropertyChanged(string propertyName)
      {
          if (PropertyChanged != null)
              PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
      }
  </code></pre>