How to invoke action to run in background, but only execute when the user is idle

Topics: Actions & Coroutines
Jul 12, 2012 at 6:07 PM

I have a search textbox that needs to execute search code, in the background, and present some results to the user. I only want the action bound to the textbox to execute when the user is idle (essentially equivalent to the old OnIdle event). What are some the best ways to accomplish this?

 

Thanks!

Jul 13, 2012 at 10:36 PM

I suppose that would work on the OnIdle event... Reactive Extensions would probably work fairly well.  Or something alone those lines.

Jul 13, 2012 at 10:44 PM

I don't see any CM samples that show the use of Rx here on the project site. Do you know of any examples online elsewhere? 

 

The equivalent of the OnIdle event is DispatcherPriority.ApplicationIdle.

Jul 21, 2012 at 3:47 AM

Github for Windows uses CM + Reactive XAML, which uses Rx behind the scenes. So you could go Reflector the app.