Why does my Silverlight BusyIndicator remain invisible after setting IsBusy = true?

My BusyIndicator works as expected when DomainDataSource retrieves data. But the control remains invisible when I set IsBusy to true.

I am using Silverlight 4 and the BusyIndicator toolkit. In XAML, I bound the BusyIndicator.IsBusy property to the IsBusy property of my DomainDataSource control. The BusyIndicator control wraps my main grid (LayoutRoot) and all child controls.

<toolkit:BusyIndicator IsBusy="{Binding ElementName=labSampleDomainDataSource, Path=IsBusy}"  Name="busyIndicator1">
<Grid x:Name="LayoutRoot">

</Grid>
</toolkit:BusyIndicator>

The problem is that BusyIndicator is not displayed when I set busyIndicator1 = true; in the button click event. Any idea what I'm doing wrong?

+3
source share
1

. , , .

. , , , , ( , , ). IsBusy .

, . - . , , , .

BackgroundWorker DoWork , .

myButton_Click(object sender, RoutedEventArgs e)
{
    isbusyindicator1.IsBusy = true;
    var bw = new BackgroundWorker();
    bw.DoWork += (s, args) =>
    {
       //Stuff that takes some time
    };
    bw.RunWorkerCompleted += (s, args) =>
    {
         isbusyindicator1.IsBusy = false;
    };
    bw.RunWorkerAsync();
}

, , . IsBusy .

+7

Source: https://habr.com/ru/post/1787711/


All Articles