Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 128411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:37:52+00:00 2026-05-11T05:37:52+00:00

I make calls to a WCF service from my silverlight application. I am doing

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:37:53+00:00Added an answer on May 11, 2026 at 5:37 am

    There is no property or event on the generated client reference class that can be used to identify that an asynchronous call to a method of a Silverlight WCF service is currently in progress. You can record this yourself using a simple boolean variable though, or by using the blocking thread synchronization that you mentioned you want to avoid in this case.

    Here’s an example of how to do what you want using the Silverlight ProgressBar control to indicate waiting/working on a call to a very simple Silverlight web service:

    Page.xaml:

    <UserControl x:Class='SilverlightApplication1.Page'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'      xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'      Width='400' Height='100'>      <StackPanel x:Name='LayoutRoot' Background='White'>         <Button x:Name='ButtonDoWork' Content='Do Work'                 Click='ButtonDoWork_Click'                 Height='32' Width='100' Margin='0,20,0,0' />         <ProgressBar x:Name='ProgressBarWorking'                      Height='10' Width='200' Margin='0,20,0,0' />     </StackPanel> </UserControl> 

    Page.xaml.cs:

    using System.ComponentModel; using System.Windows; using System.Windows.Controls; using SilverlightApplication1.ServiceReference1;  namespace SilverlightApplication1 {     public partial class Page : UserControl     {         public bool IsWorking         {             get { return ProgressBarWorking.IsIndeterminate; }             set { ProgressBarWorking.IsIndeterminate = value; }         }          public Page()         {             InitializeComponent();         }          private void ButtonDoWork_Click(object sender, RoutedEventArgs e)         {             Service1Client client = new Service1Client();             client.DoWorkCompleted += OnClientDoWorkCompleted;             client.DoWorkAsync();              this.IsWorking = true;         }          private void OnClientDoWorkCompleted(object sender, AsyncCompletedEventArgs e)         {             this.IsWorking = false;         }     } } 

    Setting IsIndeterminate to true after the asynchronous call to DoWork makes the progress bar animate indeterminately like this:

    alt text http://www.freeimagehosting.net/uploads/89620987f0.png

    Because the callback to OnClientDoWorkCompleted happens on the UI thread it’s fine to change the value of the IsIndeterminate property back to false in the method body; this results in a non-animating blank ProgressBar again as the working/waiting is now finished.

    Below is the code for the web service and the DoWork method that the above code calls asynchronously, all it does it simulate some long running task by sleeping for 5 seconds:

    using System; using System.ServiceModel; using System.ServiceModel.Activation; using System.Threading;  namespace SilverlightApplication1.Web {     [ServiceContract(Namespace = '')]     [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]     public class Service1     {         [OperationContract]         public void DoWork()         {             Thread.Sleep(TimeSpan.FromSeconds(5.0));             return;         }     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make multiple asynchronous calls from inside a wcf service hosted in
I am implementing a WCF service (Contract A) that will eventually make calls to
We've got a scheduling application running that calls a WCF service to run nightly
I´m deploying a Silverlight application, which consumes data from a WCF DataService then exposes
i have an Autocomplete ajax control that calls a WCF service method automatically. this
I'm currently trying to find good way to make calls to WCF services in
In C#, how do I make an async call to a WCF Web Service?
Here's my scenario: I need to make three or four calls to different WCF
Is there a way in PHP to make HTTP calls and not wait for
This question is about Why does autoboxing make some calls ambiguous in Java? But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.