title: C# BackgroundWorker get results
body: <p>How do I get results from the BackgroundWorker in this case? I'm also open to doing things in in alternative manner(such as not using BackgroundWorker). The goal is to do all my jobs in parallel, starting at the same time. I actually honestly don't know if all jobs will be completed in parallel using bw. I'm still learning this threading stuff. I'm using WPF/XAML (I'm pretty sure that makes a big difference on how threading type code is written).  </p>
  
  <pre><code>namespace JobFactory
  {
      public partial class MainWindow : Window
      {
          MainWindow()
          {
              InitializeComponent();
              Manager boss = new Manager(); 
              string[] reports = boss.runWorkers(50); 
          }
      }
  
  }
  namespace Workers
  {
      class Manager
      {
          public reports[] runWorkers(int numWorkers)
          {
              BackgroundWorker worker = new BackgroundWorker(); 
  
              for (int i = 0; i &lt; numWorkers; i++) 
              {
                  worker.DoWork += delegate(object s, DoWorkEventArgs args)
                  {
                      string report = this.job(); 
                  };
              }
  
              worker.RunWorkerAsync();
  
              //Return reports here...
          }
  
          public string job()
          {
              Thread.Sleep(2000);
              return "Job Completed"; 
          }
      }
  }
  </code></pre>