IsBusy Property
Collapse the table of content
Expand the table of content

BackgroundWorker.IsBusy Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets a value that indicates whether the BackgroundWorker is running a background operation.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)

public bool IsBusy { get; }

Property Value

Type: System.Boolean
true, if the BackgroundWorker is running a background operation; otherwise, false.

The BackgroundWorker starts a background operation when you call the RunWorkerAsync method. If the background worker's IsBusy property is true, calling RunWorkerAsync again will raise an InvalidOperationException.

The following code example demonstrates the use of the IsBusy property to check whether a background operation is already running before starting it. To view the complete code for this sample, see How to use a background worker for Windows Phone 8.


private void buttonStart_Click(object sender, RoutedEventArgs e)
{
    if (bw.IsBusy != true)
    {
        bw.RunWorkerAsync();
    }
}


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft