title: WPF progress bar update with dispatcher
body: <p>I am trying to update a progressbar using the dispatcher but somehow cannot think where to place the dispatcher.Invoke and what to pass inside it.</p>
  
  <p>Im trying to import files and needs to show the user how many files are imported using the progress bar.</p>
  
  <p>so I have a delegate:</p>
  
  <pre><code>public delegate void DelegateA(ProgressClass progressClass);
  </code></pre>
  
  <p>im calling the delegate and passing the function to call.</p>
  
  <pre><code>DelegateA(FunctionA);
  </code></pre>
  
  <p>so while importing each file it calls the FunctionA.</p>
  
  <pre><code>private void FunctionA(ProgressClass progressClass)
  {
      **//Put dispatcher.invoke here?**
      progressbar.updateprogress(progressclass);
      progressbar.show();
  }
  </code></pre>
  
  <p>The progressclass has two properties which sets the progressbar's value(how many have been processed) and total items to process.</p>
  
  <p>I can't understand what delegate method to pass in InvokeMethod(THreadPriority, delegate method)?</p>
  
  <p>Sorry, if something is not clear.</p>