title: Dispatcher on an event by itself and through delegate
body: <p>I have a 3rd party DLL which I receive data from a device through network socket. <code>Foo_WorkCompleted</code> is an event subscribed to an action when data is received and is automatically fired. My first try is to check if the thread has been accessed, and if not, call itself again from a new thread to update the UI. But I receive threading exception that it is occupied. Then I tried calling a delegate from the dispatcher, that works. </p>
  
  <p>I do not see difference between the two. An event should just work like a delegate. So, why one works but not the other. Would someone please help explain?  </p>
  
  <p><strong>This does not work (threading exception):</strong></p>
  
  <pre><code>private void Foo_WorkCompleted(object sender, WorkCompletedEventArgs e)
  {
      if (Dispatcher.CheckAccess())
      {
          Dispatcher.BeginInvoke(
          (EventHandler&lt;WorkCompletedEventArgs&gt;)Foo_WorkCompleted, sender, e);
          return;
      }
  
      SomeMethod();
  }
  </code></pre>
  
  <p><strong>This works:</strong></p>
  
  <pre><code>private delegate void UpdateUIDelegate();
  
  private void Foo_WorkCompleted(object sender, WorkCompletedEventArgs e)
  {      
       Dispatcher.BeginInvoke(
             DispatcherPriority.Send, new UpdateUIDelegate(SomeMethod));
  }
  </code></pre>