tags:

views:

15

answers:

3

I have a Silverlight App which gets its data from a database. My Silverlight app (running in the browser) retrieves the data through a web service. Pretty standard setup.

But there is some data which has to be there all the time or the App is in an invalid state - think data to fill drop downs etc. So I need this data to be "pre-loaded" into the App before it's sent down to the client so that it's never in an invalid state. Today I load this data via a web service call when my first page is initialized which can some times take a few seconds - during that time my App is in an invalid state.

Is there a way to populate data (from a backend database) in my Silverlight App before it's sent to the browser?

A: 

It is valid for an app to start and not be ready to use for a while, so long as the user cannot interact with it (or see the broken bits:))

Better to ensure your app has a splash screen/login page etc that displays until such time as the required resources are loaded. Once loaded you can set an app state to then show the main screen.

I had the same problem with a website that loaded the menu items via a service (as the text was data driven). Wound up running a progress spinner over the top (with a full-screen background).

Enough already
Great, thanks. Very helpful.
will
A: 

I don't think you can. The application runtime occurs on the client's machine. I would suggest putting up a loading dialog while you bring those items down from the database.

Wix
A: 

What HiTech Magic said. Best practice for this is to use a splash screen or login page. You can also have your buttons (and interaction) disabled by default, and after the data is loaded, enable the UI. I would go with the spash screen though..

jdr120