Hi everyone! 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:
public Brasil()
{
//InitializeComponent();
webService = new DataRetrieverReference.DataRetrieverClient();
webService.GetCounterCompleted += new EventHandler<WebPortos.DataRetrieverReference.GetCounterCompletedEventArgs>(webService_GetCounterCompleted);
webService.GetCounterAsync();
webService.GetDataCompleted += new EventHandler<DataRetrieverReference.GetDataCompletedEventArgs>(webService_GetDataCompleted);
}
void webService_GetCounterCompleted(object sender, WebPortos.DataRetrieverReference.GetCounterCompletedEventArgs e)
{
int counter = e.Result;
this.dictionary = new Dictionary<int, WebPortos.DataRetrieverReference.vwPortos_SEP>();
for (int i = 0; i < counter; i++)
{
webService.GetDataAsync(i);
}
InitializeComponent();
}
As you can see, I put it inside my data loading method, but it didn't work. Any tips?