title: GUI frozen while i update my ObservableCollection
body: <p>I have a WPF application that displays an ObservableCollection. It's about 182 rows, and the object (let's call it PositionLight) inside the collection has about 70 properties to display.</p>
  
  <p>All calculation to input data in these properties are made in a second thread which will recalc everything every 20 secondes, and will send a List to the WPF window, thx to an Event. This way calculation doesn't slow down the GUI.</p>
  
  <p>the List is transformed in an ObservableCollection in the constructor of the EventArgs sent with the event to the GIU.</p>
  
  <p>The problem is even when i use a BeginInvoke and a delegate to do:</p>
  
  <p>myGUICollection = myEventArgsCollection</p>
  
  <p>the GUI will be frozen for 3 to 4 seconds... I've put a lot of Console.Writeline to find out where is the bottleneck, but it looks like the freeze will occurs just after it leaves the function called by the BeginInvoke. I'm really lost here.</p>
  
  <p>I'm using a 4 core PC with 2.5Go RAM, so i don't think this is a hardware problem. </p>
  
  <p>Do you guys have an idea?</p>
  
  <p>Some code to give you a better idea of the insert in the GUI:</p>
  
  <pre><code>    public bool myCoreScope_OnCoreCalculationHandler(object myObject, CoreCalculationEventArgs myEventArgs)
      {
  
          foreach (PositionLight item in myEventArgs.MyPositionList)
          {
              lv.Dispatcher.BeginInvoke(new DisplayPositionItemCallBack(DisplayPositionItem), DispatcherPriority.Send, new object[] { item });
          }
  
      }
  
  
      private delegate void DisplayPositionItemCallBack(PositionLight item);
  
      private void DisplayPositionItem(PositionLight item)
      {
          try
          {
             MyPositionList.Remove(MyPositionList.First(position =&gt; position.ID== item.ID));
          }
          catch (Exception)
          { }
          MyPositionList.Add(item);
      }
  </code></pre>