In the callback method, I am trying to get the text property textBox as follows:
string postData = tbSendBox.Text;
But since it is not running in the UI thread, it gives me an exception for cross threads.
I need something like this:
Dispatcher.BeginInvoke(() => { string postData = tbSendBox.Text; });
But this is done asynchronously. Synchronous version:
Dispatcher.Invoke(() => { string postData = tbSendBox.Text; });
But Dispatcher.Invoke () does not exist for Windows Phone. Is there something equivalent? Is there any other approach?
Here is the whole function:
public void GetRequestStreamCallback(IAsyncResult asynchronousResult) { HttpWebRequest request = (HttpWebRequest)asynchronousResult.AsyncState;
source share