Update progressbar from a backgroundworker in WPF
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to make a progressbar advance using a BackgroundWorker . The final goal is to show the progress of a background search, but I first want to get to know the progress bar by doing a simple simulation. This is the code: public MainWindow() { InitializeComponent(); worker = new BackgroundWorker(); // variable declared in the class worker.WorkerReportsProgress = true; worker.DoWork += new DoWorkEventHandler(worker_DoWork); worker.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged); worker