title: Dispatcher.CurrentDispatcher.BeginInvoke Not Invoking
body: <p>I have a <code>FileSystemWatcher</code> and the events raised by this when a watched file changes are raised on a different thread from the UI thread. To avoid and cross-thread acess volation fun, I am attempting to use </p>
  
  <pre><code>public void RaisePathChanged(object sender, RenamedEventArgs e)
  {
      Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() =&gt; 
      {
          // Some code to handle the file state change here.
      }));
  }
  </code></pre>
  
  <p>This compiles fine and the <code>RaisePathChanged</code> is fired as it should be. However, the code inside the delegate <code>Action(() =&gt; { /*Here*/ })</code> never gets called/invoked, the code is merely skipped. </p>
  
  <p><strong>Why is the code being skipped, how can I fix it and is this the best way to insure code is run on the thread that created it in WPF?</strong></p>
  
  <p>Thanks for your time.</p>