I\'m trying to use the async HttpWebRequest
in Silverlight for Windows Phone. All works perfect until I get to the where I should call
private stati
To be honest, this isn't a good idea. Having the wait on the main (UI) thread will lock the phone up and create an unresponsive UI. It'll be better in the long run not to fight the async network access in WP7 and Silverlight, the code can be more complex in places and you end up having a lot of methods that take call backs, but having a more response UI is better than having it lock up.
var request = WebRequest.CreateHttp(uri);
request.BeginGetResponse(r =>
{
var reponse = request.EndGetResponse(r);
// Do things response here
}, null);
// Let the method end and not wait