Folks,
In my application, when the user hits "Submit" button, I have to
make a Web service call asynchronously. Here is what I do.
1. Disable a bunch of controls, update some text:
this._btnSubmit.IsEnabled = false;
...
this._lblInfo.Text = "Connecting..."
2. Use Dispatcher.BeginInvoke for the actual Web service call.
this.Dispatcher.BeginInvoke(DoTheStuff, DispatcherPriority.ContextIdle);
The idea is to that the UI will get updated before the actual
asynchronous call to the Web service is made.
The problem is that the UI is not updating immediately. It takes a
few seconds before the controls disable and the text appears.
What is it that I need to do to ensure that the UI gets
updated?
I probably could spawn a background thread but that would be an
overkill given that the Web service call is already asynchronous.
Thank you in advance for your help.
Regards,
Peter