How to use WPF Background Worker

Add using Declare Background Worker: Subscribe to events: Implement two methods: Run worker async whenever your need. Track progress (optional, but often useful)a) subscribe to ProgressChanged event and use ReportProgress(Int32) in DoWorkb) set worker.WorkerReportsProgress = true; (credits to @zagy)

The calling thread cannot access this object because a different thread owns it

This is a common problem with people getting started. Whenever you update your UI elements from a thread other than the main thread, you need to use: You can also use control.Dispatcher.CheckAccess() to check whether the current thread owns the control. If it does own it, your code looks as normal. Otherwise, use above pattern.