开发者

How do you get an Idle Message in a UserControl class in C# / Silverlight?

开发者 https://www.devze.com 2023-04-09 21:24 出处:网络
How do you get an Idle Message in a UserControl class in C# / Silverlight? Back when I was programming in C++ and MFC there was an idle messag开发者_开发问答e for user intervace classes that one coul

How do you get an Idle Message in a UserControl class in C# / Silverlight?

Back when I was programming in C++ and MFC there was an idle messag开发者_开发问答e for user intervace classes that one could overwrite and make use of. Is there something like that in C# and/or Silverlight?


In WPF (which uses mostly the same Dispatcher API as Silverlight), you can use the Dispatcher to dispatch a task with the Idle or ApplicationIdle priority:

How do we do idle time processing in WPF application?

...But in Silverlight, this functionality doesn't exist (intentionally so) (see http://forums.silverlight.net/t/149518.aspx).

If you want to ensure your task doesn't hang the UI, use BeginInvoke as opposed to Invoke.

0

精彩评论

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