We have seen a code-behind approach for the
BusyIndicator where based on the
Load operation, we set the
IsBusy property of the
false. The following example shows a sample code which enables the
BusyIndicator during continuous operations and using the code-behind approach.
biLoading.IsBusy = true;
biLoading.IsBusy = false;
The above approach is straightforward and this post is about how to use the
BusyIndicator declaratively along with XAML code. As we know, the
DomainDataSource control enables interaction between the XAML user interface and the
DataContext. Mostly, it is used for achieving binding to a specific control through XAML.
The sample code used for data binding using the
DomainDataSource control is as follows:
More details about the
DomainDataSource control can be found here.
Using the BusyIndicator Declaratively, Along with XAML
Let's say we want to implement the above
BusyIndicator scenario not using the code behind. To do that, drag and drop the
BusyIndicator control to the Silverlight page and make the following changes to the XAML code:
<toolkit:BusyIndicator Height="75" HorizontalAlignment="Center"
Isbusy property of the
BusyIndicator to the
DomainDataSource control, exactly the same as above.