1

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 message for user intervace classes that one could overwrite and make use of. Is there something like that in C# and/or Silverlight?

xarzu
  • 8,657
  • 40
  • 108
  • 160

1 Answers1

2

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.

Community
  • 1
  • 1
Jeff
  • 35,755
  • 15
  • 108
  • 220