changing the label text (or complex, we can say that the progress bar is based on text). in winforms you are just Invalidate / Update.
But how to do it in WPF without using background threads. ???
public static class ExtensionMethods { private static Action EmptyDelegate = delegate() { }; public static void Refresh(this UIElement uiElement) { uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate); } } private void LoopingMethod() { for (int i = 0; i < 10; i++) { label1.Content = i.ToString(); label1.Refresh(); Thread.Sleep(500); } }
Link: http://geekswithblogs.net/NewThingsILearned/archive/2008/08/25/refresh--update-wpf-controls.aspx
Perhaps you should learn more about the topic of Bindings ..
Mostly bindings will manage this for you.