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

Topics: Actions & Coroutines
Jul 12, 2012 at 7: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?



Jul 13, 2012 at 11: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 11: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 4:47 AM

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