I want to use something similar to the BackgroundWorker, which is known from the full .NET Framework, on mobile devices. Sadly it is not available in the compact framework.
What can I use instead?
I want to use something similar to the BackgroundWorker, which is known from the full .NET Framework, on mobile devices. Sadly it is not available in the compact framework.
What can I use instead?
There is an MSDN site discussing the Background Processing Techniques on the CF.
The most common option is to use ThreadPool.QueueUserWorkItem instead of a BackgroundWorker, although there are other options.
There is implementation of BackgroundWorker for CF: http://www.danielmoth.com/Blog/2004/12/backgroundworker-sample.html
Here is an implementation that was created using Reflector. You could use Reflector to check out various implementations within the .NET framework
There is a framework, called Smart Device Framework by OpenNETCF, which tries to fill the gap between the compact framework and the full .NET framework. This framework contains and provides a BackgroundWorker
implementation.
This framework is available as a community version, which can be used for free.
From the old version 1.x
is also the source code directly available from here (scroll down to the last link). This source code is similar to the link, which @Filip Navara provided.
It helped me alot. There is a drop in replacement class which needs only minor fixes.It's "only" vb-code but there are numerous tools online to convert to C#.
– Meister Schnitzel Dec 05 '13 at 10:51