當我使用的WinForms,我會在我的bg_DoWork
方法做到了這一點:如何從BackgroundWorker線程內更新標籤?
status.Invoke(new Action(() => { status.Content = e.ToString(); }));
status.Invoke(new Action(() => { status.Refresh(); }));
但是在我的WPF應用程序,我得到一個錯誤,指出Invoke
不爲Label
存在。
任何幫助,將不勝感激。
這個。因爲你不想在不同的線程上更新UI控件。 –