title: the calling thread cannot access this object because a different thread owns it in wpf
body: <pre><code>private void Window_Loaded(object sender, RoutedEventArgs e)
  {
      bw.DoWork += new DoWorkEventHandler(bw_DoWork);
  }
  
  private void btnAddGroup_Click(object sender, RoutedEventArgs e)
  {  
      if (bw.IsBusy != true)
      {
          bw.RunWorkerAsync();
      }   
  }
  
  System.Timers.Timer timer = null;
  
  private void bw_DoWork(object sender, DoWorkEventArgs e)
  {
      timer = new System.Timers.Timer();
      timer.Interval = 1000;
      timer.Enabled = true;
      timer.Elapsed += new ElapsedEventHandler(UpdateChatContent);
  }
  
  public void UpdateChatContent()
  {
      var myVar=(from a in db  select a).tolist();
      datagrid1.itemsSource=myVar;//here is the exception occurs
  }
  </code></pre>