RunWorkerAsync Method
Collapse the table of content
Expand the table of content

BackgroundWorker.RunWorkerAsync Method

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

Starts running a background operation.

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

public void RunWorkerAsync()

The RunWorkerAsync method submits a request to start the operation running asynchronously. When the request is processed, the DoWork event is raised, which in turn starts running your background operation.

If the background operation is already running, calling RunWorkerAsync again will raise an InvalidOperationException.

The following code example demonstrates the use of the RunWorkerAsync method to start a background operation. 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