title: My BackgroundWorker still blocks my UI
body: <p>I have a time consuming method in a class that's buried in a .dll which I don't have the source for. I don't want to block the UI when I call this method. I've been trying to use a BackgroundWorker to do this. I call RunWorkerAsync from a btn_Click event handler. When I have the dllClass instance created outside of the worker thread (like below) the UI freezes until the operation is finished. The operation also blocks the timer from ever ticking.</p>
  
  <pre><code>public static dllClass dllClassInstance = new dllClass();
  
  void worker1_DoWork(object sender, DoWorkEventArgs e)
  {
      dllClassInstance.TimeConsumingMethod();
  }
  </code></pre>
  
  <p>On the other hand if I instance the class inside the worker thread (like the next code segment) it works as intended.</p>
  
  <pre><code>void worker1_DoWork(object sender, DoWorkEventArgs e)
  {
      dllClass dllClassInstance = new dllClass();
  
      dllClassInstance.TimeConsumingMethod();
  }
  </code></pre>
  
  <p>The issue with using the latter is that I need access to the class instance outside of that specific worker, since I have to call other methods before and after the time consuming method. I also tried passing the class instance into the BackgroundWorker through e.Argument but it also resulted in the UI freezing. Does anyone have suggestions how to call that method without blocking the UI?</p>