title: Async function - callback using object owned by main thread
body: <p>In my .NET application built with WPF and C# I call an async function using <a href="http://msdn.microsoft.com/en-us/library/2e08f6yc.aspx" rel="nofollow noreferrer">AsyncMethodCaller</a>. In the callback I'd like to update some data in the GUI, but I'm not allowed to as this is owned by the main thread. How to I do it? </p>
  
  <ul>
  <li>Invoke an update on the main thread? How? </li>
  <li>Pass an object (e.g. ViewModel) as state to the callback and update data on this - which again is bound to the GUI? </li>
  <li>Some other way? </li>
  </ul>
  
  <p>What's the common, recommended way of handling this? </p>
  
  <p>The runtime error given is: </p>
  
  <blockquote>
    <p>The calling thread cannot access this object because a different thread owns it.</p>
  </blockquote>