title: Access textbox from another method or Async
body: <p>I'm somewhat new to C# and I'm having some issues retrieving a <code>textbox</code> value in an asynchronous method. I the thread to retrieve the text input in the UI and use it in the code. VS 2010 accepts my code but when I start to debug it gives me the following exception
  <code>Invalid cross-thread access</code>. Ideas? Am I missing something?</p>
  
  <pre><code>public void Response_Completed(IAsyncResult result)
  {
      HttpWebRequest request = (HttpWebRequest)result.AsyncState;
      HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(result);
  
      using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
      {
          JObject rootObject = JObject.Load(new JsonTextReader(streamReader));
  
          string tracknum = trackid.Text; // Invalid cross-thread access exception
          string source = rootObject[tracknum]["source"].ToString();
  
          Deployment.Current.Dispatcher.BeginInvoke(() =&gt;
          {
              //removed
          });
      }
  }
  </code></pre>
  
  <p>Note: I'm attempting to do this on the Windows Phone 7 Platform</p>