xarzu
xarzu

Reputation: 9479

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

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?

Upvotes: 1

Views: 199

Answers (1)

Jeff
Jeff

Reputation: 36573

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.

Upvotes: 2

Related Questions