HI,
I've following scenario:
* I'm working on WPF application, with Nav-Frames and XAML Pages concept for navigation between pages.
* On Unload of a page I've created a backgroundworker and started it asynchronously
BackgroundWorker m_AsyncWorker = new BackgroundWorker();
m_AsyncWorker.WorkerReportsProgress = true;
m_AsyncWorker.WorkerSupportsCancellation = true;
m_AsyncWorker.ProgressChanged += new ProgressChangedEventHandler(bwAsync_ProgressChanged);
m_AsyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwAsync_RunWorkerCompleted);
m_AsyncWorker.DoWork += new DoWorkEventHandler(bwAsync_DoWork);
m_AsyncWorker.RunWorkerAsync(processID);
and I've some implementations of events.
private void bwAsync_DoWork(object sender, DoWorkEventArgs e)
{
}
private void bwAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
}
private void bwAsync_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
}
I want to trace the backgroundworker thread and abort it from any other page and also I'm not willing to keep the object of the page (where the worker task was started) to be active.
In my application the provision of creating a global class where I could put up the worker object is also not possible.
Is there any way to trace a worker task from threadpool or something?
Kindly suggest.
Thanks,
Abhishek.