Search code examples
c#silverlightwcf-ria-services

WCF RIA Services -- take action when all data is loaded


So, I am just getting started with .WCF RIA Services and Silverlight.

Here's what I need to do: I need to make a couple of calls to my domain service to load data. So, I'm using the Load() method on the Context object.

I need to take some action when all of the queries have completed. I see that I can specify a callback for each individual load, but what I really want to do is to register a callback that will be executed when all of the loads are complete.

Is there a built-in way to do this with RIA services/Silverlight, or will I need to roll my own?

BTW: I'm not doing anything all that crazy -- I just don't want my form to be interactive until the data is loaded (I don't want to block the UI thread, I just want to show a progress bar/dancing hampster until all the data is loaded)


Solution

  • This http://blogs.msdn.com/b/smccraw/archive/2009/07/15/a-net-ria-services-data-load-batch-manager.aspx worked nicely for me.

    If you don't want the users interacting with the page, use an activity indicator (I think it's in the Silverlight Toolkit now) to block the app while loading.