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

BusyIndicator only works the first time.

1 Answer 95 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Ramiro
Top achievements
Rank 1
Ramiro asked on 23 May 2014, 08:33 PM
Hi, I have this MVVM app and I need to show a BusyIndicator when it does this heavy load method.

It works fine the first time, when I try to run it again, looks like it's not starting the BusyIndicator. And it just does nothing.

Here's the code I'm using to show the BusyIndicador

The BusyIndicator it's binding to this property

private bool _isBusy;
public bool IsBusy
{
    get { return _isBusy; }
    set
    {
        if (_isBusy == value) return;
 
        _isBusy = value;
        OnPropertyChanged();
    }
}

And here's how I change the state of the binded property


var backgroundWorker = new BackgroundWorker();
 
backgroundWorker.DoWork += delegate
{
    IsBusy = true;
    DoHeavyWork();
};
 
backgroundWorker.RunWorkerCompleted += delegate
{
    IsBusy = false;
};
 
backgroundWorker.RunWorkerAsync();

I also tried setting the IsBusy property outside of the DoWork method, but got the same results.

Any idea what it might be the issue?


1 Answer, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 26 May 2014, 10:24 AM
Hello Ramiro,

Thank you for contacting us.

We are not aware of a issue in the current version of RadBusyIndicator that could be causing such behavior of the control. The BusyIndicator control is an UI control and as any UI control it is rendered in the UI thread. If that thread is frozen the RadBusyIndicator will not be shown. It looks like you are aware of this because one way to make sure that the UI is not frozen is to use an BackgroundWorker and toggle the IsBusy property of the control in its events.

We tried to reproduce the issue on our side but to no avail. When using a BackgroundWorker in order to toggle the IsBusy property of the control no unexpected behavior was observed. Could you try to reproduce the issue in the attached test project and send it back to us in a new support thread in order for us to be able to observe the described behavior on our side?

Regards,
Vladi
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
BusyIndicator
Asked by
Ramiro
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or