title: Update UI element from a different thread in Windows 8/WinRT
body: <p>I have a button and a textblock in a Windows 8 "Metro" application. When the button is clicked it calls a webservice via HttpWebRequest.</p>
  
  <pre><code>private void buttonGo_Click(object sender, RoutedEventArgs e)
  {
      HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://localhost/");
  
      req.BeginGetResponse(ResponseCallback, req);
  }
  
  private void ResponseCallback(IAsyncResult asyncResult)
  {
      HttpWebRequest req = (HttpWebRequest)asyncResult.AsyncState;
  
      HttpWebResponse res = (HttpWebResponse)req.EndGetResponse(asyncResult);
      Stream streamResponse = res.GetResponseStream();
      StreamReader streamRead = new StreamReader(streamResponse);
      string responseString = streamRead.ReadToEnd();
  
      info.Text = responseString; // Can't do this as outside the UI thread
  }
  </code></pre>
  
  <p>I want to update <code>info.Text</code> with the data returned from the WebRequest, however it causes an error: <em>"The application called an interface that was marshalled for a different thread."</em> I understand that this is because it is not being called from the UI thread.</p>
  
  <p>I have found various different solutions involving <code>Dispatcher</code>, <code>SynchronizationContext</code>, the <code>await</code> keyword.</p>
  
  <p>What is the easiest/best way to do this?</p>