title: Silverlight Async Design Pattern Issue
body: <p>I'm in the middle of a Silverlight application and I have a function which needs to call a webservice and using the result complete the rest of the function.</p>
  
  <p>My issue is that I would have normally done a synchronous web service call got the result and using that carried on with the function.  As Silverlight doesn't support synchronous web service calls without additional custom classes to mimic it, I figure it would be best to go with the flow of async rather than fight it.  So my question relates around whats the best design pattern for working with async calls in program flow.</p>
  
  <p>In the following example I want to use the myFunction TypeId parameter depending on the return value of the web service call.  But I don't want to call the web service until this function is called.  How can I alter my code design to allow for the async call?</p>
  
  <pre><code>        string _myPath;
  
      bool myFunction(Guid TypeId)
      {
          WS_WebService1.WS_WebService1SoapClient proxy = new WS_WebService1.WS_WebService1SoapClient();
          proxy.GetPathByTypeIdCompleted += new System.EventHandler&lt;WS_WebService1.GetPathByTypeIdCompleted&gt;(proxy_GetPathByTypeIdCompleted);
          proxy.GetPathByTypeIdAsync(TypeId);
  
          // Get return value
  
          if (myPath == "\\Server1")
          {
              //Use the TypeId parameter in here
          }
      }
  
      void proxy_GetPathByTypeIdCompleted(object sender, WS_WebService1.GetPathByTypeIdCompletedEventArgs e)
      {
          string server = e.Result.Server;
          myPath = '\\' + server;
      }
  </code></pre>
  
  <p>Thanks in advance,
  Mike</p>