views:

5020

answers:

2

I make calls to a WCF service from my silverlight application. I am doing this asynchronously and I am not blocking execution after making the async. call (that means, I am not using wait-join mechanism frm this page). I do not want the flow to get blocked.

However, I would like to detect that the WCF call has gone into a wait state so that I can show a busy icon on the UI - a visual communication indicating that things are happening behind the UI.

I can change my code such that I can start to animate the busy icon and stop that animation when the asynchronous call completes.

However, this is a lot of bolierplate code, and with more calls being made throughout the client code, this is only going to get messier.

So, is there any method or property exposed by the wcf service client reference code that can be used to trigger off events when any async wcf service calls go into a wait state, and likewise, trigger off events when the all async wcf service calls finish?

+2  A: 
Peter McGrattan
Thanks, I will definitely try this.I till I will need to add some sort of synchronization (locking) around the IsWorking variable and make it an int. This is because there will be async requests made in parallel, and the animation should continue till all calls complete.
Apoorv Shrivastava
A: 

What if is "backwards"???? i need the GUI to wait for the service??? i am in a deadlock at the moment