This is a migrated thread and some comments may be shown as answers.

BusyIndicators's BusyContent appears too late

2 Answers 135 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 11 Apr 2012, 03:16 PM

I'm experiencing a strange behavior: The RadBusyIndicators's content (the yellow circle and the text "Loading...") appears far too late, but the BusyIndicator becomes grey at the right moment. The content (progress bar) appears not until the time-consuming action is over.

Here is what I'm doing in Pseudocode:

MyDialog dialog = new Dialog();             // A Window that contains the BusyIndicator
dialog.myRadBusyIndicator.IsBusy = true;    // Startup with the BusyIndicator activated
dialog.Dispatcher.BeginInvoke(new System.Action(MyLoginAction));   // Start some time-consuming action in the Background
dialog.ShowDialog();                        // Show the user a Dialog with busy information

Problem: The yellow circle in the BusyIndicator shows up AFTER the time-consuming action is over, but Busy-State (graying) is activated correctly when the Dialog pops up.

Some intricate threading problem?

2 Answers, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 17 Apr 2012, 11:50 AM
Hi Peter,

The code executed into a Dispatcher.BeginInvoke always run on the UI thread. You will have to execute the time-consuming code into a BackgroundWorker to avoid this. You can find a sample example attached.

Kind regards, Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Peter
Top achievements
Rank 1
answered on 17 Apr 2012, 03:16 PM

Thanks a lot, Ivo!

That was the solution to my problem. Great support! 

The lesson learned (for me and others) is:

When using the RadBusyIndicator, you should always run the time-consuming code in a BackgroundWorker or in a separate thread - even if UI Dispatcher.BeginInvoke seems to work at first sight...

Tags
BusyIndicator
Asked by
Peter
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Peter
Top achievements
Rank 1
Share this question
or