Библиотека Reactive Extensions (Rx) идеально подходит для этого.Взгляните сюда:
http://www.jaylee.org/post/2010/06/22/WP7Dev-Using-the-WebClient-with-Reactive-Extensions-for-Effective-Asynchronous-Downloads.aspx
Прокрутите вниз.Вот пример ожидания двух загрузок веб-клиента, просто замените логику здесь:
public IObservable<string> StartDownload(string uri)
{
WebClient wc = new WebClient();
var o = Observable.FromEvent<DownloadStringCompletedEventArgs>(wc, "DownloadStringCompleted")
// Let's make sure that we're not on the UI Thread
.ObserveOn(Scheduler.ThreadPool)
// When the event fires, just select the string and make
// an IObservable<string> instead
.Select(newString => ProcessString(newString.EventArgs.Result));
wc.DownloadStringAsync(new Uri(uri));
return o;
}
public string ProcessString(string s)
{
// A very very very long computation
return s + "<!-- Processing End -->";
}
public void DisplayMyString()
{
var asyncDownload = StartDownload("http://bing.com");
var asyncDownload2 = StartDownload("http://google.com");
// Take both results and combine them when they'll be available
var zipped = asyncDownload.Zip(asyncDownload2, (left, right) => left + " - " + right);
// Now go back to the UI Thread
zipped.ObserveOn(Scheduler.Dispatcher)
// Subscribe to the observable, and set the label text
.Subscribe(s => myLabel.Text = s);
}