Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
In My WPF application,

In this Application i am using One user control.

In the user control button click event we are starting one backgroundworker.

In the background worker we are exporting some data to the .Csv file.

While this process is running we need to cancel the background worker when the user close the mainwindow.

My question is how we can stop when user closes the window.

Please provide me your ideas.
Posted
Updated 31-Mar-13 19:52pm
v2

1 solution

use the Window closed event present in WPF and write the code (the process you wanted to stop.).
 
Share this answer
 
Comments
Shahin Khorshidnia 1-Apr-13 19:58pm    
http://stackoverflow.com/questions/2542326/proper-way-to-dispose-of-a-backgroundworker

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900