views:

176

answers:

2

Hi Guys,

I have a SL4 app consuming WCF services. The client make async call to the services, during this time I would like to show some sort information or busy indicator on the screen which tells the users that the app is doing something.

Now I am pretty sure SL4 has something like this, but I am drawing a blank....

Can someone please point me to the right direction?

Thanks,

Voodoo

A: 

You need an animation storyboard and then use code like this:

wcfProxyClass.DoMethodAsync()
loadingStoryboard.Begin();

Then in the Completed event handler

loadingStoryboard.End(); // not sure on this syntax

Here's a great article that should get you started. -- http://chrisa.wordpress.com/2008/10/09/a-wait-indicator-in-silverlight/

Nate Bross
@Nate Bross: is there a build in storyBoard that I can use? Can you provide any links to further explain how to use this please? thanks
VoodooChild
+1  A: 
Klinger
Thanks! what did you mean by Experimental quality band??
VoodooChild
Klinger
@Klinger: I think I would be using BusyIndicator it looks interesting. One problem with using with WCF async calls would be that if two calls are made to the service then the first one to get completed would set the "IsBusy" to false hence taking the indicator off the screen while the second call might be happening. I guess we can do further logic to set that flag to false on the last call to get completed...
VoodooChild
@VoodooChild: This is always a problem. You actually don't know when which one is the last to return. You also have to take in considereation that one of them may fail. I would take a look on Agatha project that let your make multiple calls "at the same time". The link is: http://code.google.com/p/agatha-rrsl/ and the link to the creator: http://davybrion.com/blog/2009/11/requestresponse-service-layer-series/
Klinger