WP8 TaskCompletionSource not getting Result
问题 I've an extension method for WebClient (WP8) public static Task<string> DownloadStringTask(this WebClient webClient, Uri uri) { var tcs = new TaskCompletionSource<string>(); webClient.DownloadStringCompleted += (s, e) => { if (e.Error != null) { tcs.TrySetException(e.Error); } else if (e.Cancelled) { tcs.TrySetCanceled(); } else { tcs.TrySetResult(e.Result); } }; webClient.DownloadStringAsync(uri); return tcs.Task; } and the call to this method public string GetResult() { var task = new