title: Update UI Thread from ViewModel
body: <p>I am trying to execute the simple action of updating a progress bar on my UI inside of a loop by using a <code>BackgroundWorker</code>. I don't know what I'm doing wrong.  Any help is greatly appreciated.</p>
  
  <pre><code>private void ProcessButtonClickAction(object param)
  {
     BackgroundWorker BGWUpdateUi = new BackgroundWorker();
  
     BGWUpdateUi.ProgressChanged += (sender, args) =&gt;
     {
         ProgressBarValue += args.ProgressPercentage;
         ((SelectedDwgFile)args.UserState).Status = "Completed";
     };
  
     BGWUpdateUi.WorkerReportsProgress = true;
  
      foreach(var obj in FileList)
      {
          Thread.Sleep(250);
          BGWUpdateUi.ReportProgress(pbvalueIncrement, obj);
      }
  }
  </code></pre>
  
  <p>The collection is an <code>ObservableCollection</code> and <code>ProgressBarValue</code> is bound to the value of the progress bar.</p>
  
  <p>I have looked at several of examples and no matter which one I try - <code>BackgroundWorker</code>, <code>Dispatcher</code> - they all update after the loop.</p>