title: How to make my Silverlight application get displayed after I loaded the data?
body: <p>I have a SL application that reads some data from the database, which I do through a WCF Service. I was having some delay problems due to this access, so I solved it by loading all the data into a dictionary in my app. Now I want to make sure the application will only be displayed after I loaded all this information, how can I do that? I thought that just puting my InitializeComponents after the data load would be enough, but it is not. Here is some piece of my code:</p>
  
  <pre><code> public Brasil()
   {
       //InitializeComponent();
       webService = new DataRetrieverReference.DataRetrieverClient();
       webService.GetCounterCompleted += new EventHandler&lt;WebPortos.DataRetrieverReference.GetCounterCompletedEventArgs&gt;(webService_GetCounterCompleted);
       webService.GetCounterAsync();
       webService.GetDataCompleted += new EventHandler&lt;DataRetrieverReference.GetDataCompletedEventArgs&gt;(webService_GetDataCompleted);
  
   }
  
   void webService_GetCounterCompleted(object sender, WebPortos.DataRetrieverReference.GetCounterCompletedEventArgs e)
   {
       int counter = e.Result;
       this.dictionary = new Dictionary&lt;int, WebPortos.DataRetrieverReference.vwPortos_SEP&gt;();
  
       for (int i = 0; i &lt; counter; i++)
       {
           webService.GetDataAsync(i);
       }
  
       InitializeComponent();
   }
  </code></pre>
  
  <p>As you can see, I put it inside my data loading method, but it didn't work. Any tips?</p>