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)

'Declaration
Public ReadOnly Property IsBusy As Boolean

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 Sub buttonStart_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
    If Not bw.IsBusy = True Then
        bw.RunWorkerAsync()
    End If
End Sub


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft