I am fairly new to Silverlight. I have an application I’m working on that needs some data from the server before the user is can start working with the application. This data is accessible via a WCF service on the web server.
My question is this: what is the best way to go about getting this data at Silverlight applicaiton startup?
My thought it to create a static class with a static member that would hold the results and to make the WCF service call in the Application_Startup event handler. My concern is that if this call is made asynchronously, how can I be certain that the data will have been retrieved from the service prior to the user interacting with the application?
Thanks
You need to remember that the Application_Startup method is actually loaded when the Silverlight percentage bar comes up, its is not until you get to:
that you are able to put a busy indicator or actually visually show your application.
So what i would do is on the Async call back, i would then display:
after you have recieved your data back.
The other comment talks about using a BusyIndicator, but you cant do that in the App.Xaml or App.Xaml.cs file, as at the point of time there is not main page yet.
Thanks