User:Emma Mbango
BusyIndicator
The BusyIndicator control is a wrapper control (think of a Border) where you put all of your content inside of the BusyIndicator control. BusyIndicator exposes an IsBusy property which should be set to true (possibly via data binding) whenever the relevant portion of the application is busy and won't respond to user input. When this happens, BusyIndicator automatically disables its content and shows a simple UI to let the user know what's going on. The tool can be added in any Silverlight application to show a loading indication to the user while saving some sort of operation in database. It shows progress of a task of an unknown duration and the size of the indicator can be defined by overwriting style property size. The indicator was first added in Silverlight 3 Toolkit in the November 2009 release. Generally it is useful when calling a WCF Service to store something in server or retrieving some data from server. [1] [2]
Anatomy of the BusyIndicator
[edit]When the BusyIndicator.IsBusy property is set to True, the BusyIndicator becomes visible and prevents any user interaction with the BusyIndicator’s Content. So any elements that you have defined within the Content of the BusyIndicator will be disabled. When the IsBusy property is set to False, the Content re-enables and user interaction can continue.
The Common Problem
[edit]The most common problem people are having trouble using the BusyIndicator is that they are doing everything on the UI thread. The first BusyIndicator is supposed to be shown, then the running process will occur and then the BusyIndicator will be hidden.
Solution
[edit]As stated, the long running process must occur on a separate thread. The UI thread needs to stay responsive while the process is running. The most common method to place a long running process on a separate thread is to use the BackgroundWorker. [3]