title: Understanding the Silverlight Dispatcher
body: <p>I had a Invalid Cross Thread access issue, but a little research and I managed to fix it by using the Dispatcher.</p>
  
  <p>Now in my app I have objects with lazy loading. I'd make an Async call using WCF and as usual I use the Dispatcher to update my objects DataContext, however it didn't work for this scenario. I did however find a solution <a href="https://stackoverflow.com/questions/1924408/invalid-cross-thread-access-issue">here</a>. Here's what I don't understand.</p>
  
  <p>In my UserControl I have code to call an <strong>Toggle</strong> method on my object. The call to this method is within a Dispatcher like so.</p>
  
  <pre><code>Dispatcher.BeginInvoke( () =&gt; _CurrentPin.ToggleInfoPanel() );
  </code></pre>
  
  <p>As I mentioned before this was not enough to satisfy Silverlight. I had to make <strong>another</strong> Dispatcher call within my object. My object is <strong>NOT a UIElement</strong>, but a simple class that handles all its own loading/saving. </p>
  
  <p>So the problem was fixed by calling</p>
  
  <pre><code>Deployment.Current.Dispatcher.BeginInvoke( () =&gt; dataContext.Detail = detail );
  </code></pre>
  
  <p>within my class.</p>
  
  <p>Why did I have to call the Dispatcher twice to achieve this? Shouldn't a high-level call be enough? Is there a difference between the <strong>Deployment.Current.Dispatcher</strong> and the Dispatcher in a UIElement?</p>