title: Limit binding updates per second
body: <p>I'm currently creating a program that reads out data sent via a COM port and then plots it live in a diagram. The data is displayed using the MVVM principle, which works fine when data is sent at around 10Hz. However, the device the data is being read from can go up to a refresh rate of 1 kHz, which means 1000 datasets per minute. This works fine for displaying and updating simple textboxes, however it breaks the diagram because the updating is happening too fast.</p>
  
  <p>What I think I need to do now is limit the amount of update events that is sent to the subscribed classes and pages, so that only a limited amount of data is sent through, which gives the diagram a chance to draw properly. <strong>Is there a way to limit this automatically, or what code adjustments would you suggest to do just that manually?</strong></p>
  
  <p>A small code snippet from my collection changed event:</p>
  
  <pre><code>void dataItems_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
  {
      NotifyPropertyChanged("dataItems");
      NotifyPropertyChanged("lastItem");
  
      // update any charts
      NotifyPropertyChanged("AccelXData");
      NotifyPropertyChanged("AccelYData");
      NotifyPropertyChanged("AccelZData");
  }
  
  // handle property changes
  public event PropertyChangedEventHandler PropertyChanged;
  private void NotifyPropertyChanged(string propertyName)
  {
      var handler = this.PropertyChanged;
      if (handler != null)
          handler(this, new PropertyChangedEventArgs(propertyName));
  }
  </code></pre>
  
  <p>Every dataset also has an ID that maybe can be used to check when to update manually, as an idea.</p>