Threadsafe control update for WPF

The following code shows how you can update a control (ProgressBar in this example) safely across threads.
Handy when you need to update something from a BackgroundWorker or other thread.

System.Windows.Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => this.ProgressBar1.Value = 0));