title: Raising event after Parallel.For completes job
body: <p>After pressing button following function is called.</p>
  
  <pre><code>Task.Factory.StartNew(() =&gt; 
  { 
      Parallel.For(0, cyclesCount, i =&gt; DoWork(i));
  
      if (OnJobCompleted != null)
          OnJobCompleted(this, EventArgs.Empty);                
  });
  </code></pre>
  
  <p>Further in code there is</p>
  
  <pre><code>void ladder_OnJobCompleted(object sender, EventArgs args)
  {
      txbDebug.Text = "completed";
  }
  </code></pre>
  
  <p>I know</p>
  
  <pre><code>txbDebug.Text = "completed";
  </code></pre>
  
  <p>has to be Invoked, beacause I'm raising event on different thread. But I can't figure out, how to Invoke it. This <strong>event is situated in wpf form</strong>.</p>