WPF access Label from different threads
I am using WPF for the first time. In my program I have a label which I would like to change it's text from a开发者_JS百科nother thread. However I can't really find anything related to this.
Thank you in advance for your help!
In WPF, as in Winforms, you may not access UI components from anything other than the UI thread.
You should use the dispatcher to access the UI from a background thread. This article is a good primer: http://msdn.microsoft.com/en-us/magazine/cc163328.aspx
精彩评论