title: Collection was modified; enumeration operation may not execute
body: <p>i wrote this code to create a chart(by using wpf toolkit charting) but I receive this error,</p>
  
  <pre><code>private void Window_Loaded(object sender, RoutedEventArgs e)
      {
          LoadLineChartData2();            
      }
      private void LoadLineChartData2()
      {
          time= new Timer(10);
          time.Elapsed += new ElapsedEventHandler(time_Elapsed);
          time.Start();
      }
      Timer time;
      List&lt;KeyValuePair&lt;double, int&gt;&gt; list = new List&lt;KeyValuePair&lt;double, int&gt;&gt;();
      int index = 0;
      void time_Elapsed(object sender, ElapsedEventArgs e)
      {
          list.Add(new KeyValuePair&lt;double,int&gt;(1.0/int.Parse(e.SignalTime.Second.ToString()),index++));
          this.Dispatcher.Invoke(new Action(()=&gt; {
          ((System.Windows.Controls.DataVisualization.Charting.LineSeries)mcChart.Series[0]).ItemsSource = list;
  
          if (index&gt;200)
          {
              time.Stop();
          }
          }));
      }       
  </code></pre>
  
  <p>erorr: Collection was modified; enumeration operation may not execute.</p>
  
  <p>what is the error and how I can dynamically add points??</p>