<p>If you call a web service from Silverlight like this:</p>

<pre><code>MyServiceClient serviceClient = new MyServiceClient();
void MyMethod()
{
  serviceClient.GetDataCompleted += new EventHandler&lt;GetDataCompletedEventArgs&gt;(serviceClient_GetDataCompleted);
  serviceClient.GetDataAsync();

  // HOW DO I WAIT/JOIN HERE ON THE ASYNC CALL, RATHER THAN BEING FORCE TO LEAVE THIS METHOD?

}
</code></pre>

<p>I would rather wait/join with the asych service thread inside "MyMethod" rather than leaving "MyMethod" after calling "GetDataAsync", what is the best way to do this?</p>

<p>Thanks,
Jeff</p>

To do this you would use a
ManualResetEvent
in your class (class level variable) and then wait on it.
```
```
void MyMethod()
{
  wait = new ManualResetEvent(false);
  // call your service
  wait.WaitOne();
  // finish working
}
```
```
and in your event handler code
```
```
void serviceClient_GetDataCompleted(...)
{
  // Set values you need from service
  wait.Set();
}
```
```