views:

332

answers:

3

Does the completed event of the BackgroundWorker control come back on the GUI thread or do i have to marshal that back.

Also, does the progress event come back on the GUI thread or do i have to marshal that back?

+3  A: 

Both events will be marshalled onto the UI thread.

Mitch Wheat
+3  A: 

All events are going to come back on the thread that created the instance of the BackgroundWorker. All your client has to do is listen for the event.

You've probably been here, but see also: BackgroundWorker Events

Jim H.
+3  A: 

It will be raised on the UI thread which originated the operation. Under the hood, BackgroundWorker uses a SynchronizationContext to marshaling between the two threads. Both WPF and WinForms will install an appropriate SynchronizationContext on startup.

JaredPar