silverlight   发布时间:2022-05-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Silverlight - 在非UI线程中使用Dispatcher更新UI对象大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

象WinForm编程一样,Silverlight中的UI对象,只能通过UI线程来更新。不同的是Silverlight提供了一个Dispatcher对象,可以方便的将BACkground线程对UI对象的操作marshal到UI线程上。而且,可以使用任意UI对象上的Dispatcher来更新任意UI对象:   because Silverlight has a single UI thread, it

象WinForm编程一样,Silverlight中的UI对象,只能通过UI线程来更新。不同的是Silverlight提供了一个Dispatcher对象,可以方便的将BACkground线程对UI对象的操作marshal到UI线程上。而且,可以使用任意UI对象上的Dispatcher来更新任意UI对象:

 

because Silverlight has a single UI thread,it has a single Dispatcher object that holds a queue of work items for the UI. Using the Dispatcher will allow you to update the UI from a non-UI thread.

from - http://msdn.microsoft.com/en-us/magazine/cc721609.aspx

 

You don't have to use the Dispatcher property of the object you intend to update; you can use Dispatcher on any UI object to marshal the call to the UI thread.

from - http://www.wintellect.com/CS/blogs/jprosise/archive/2008/03/26/threading-and-marshaling-in-silverlight-2-0.aspx

 

以上链接中有代码示例。

大佬总结

以上是大佬教程为你收集整理的Silverlight - 在非UI线程中使用Dispatcher更新UI对象全部内容,希望文章能够帮你解决Silverlight - 在非UI线程中使用Dispatcher更新UI对象所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。