开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜