3

How can I detect if the Application has been idle for let's say 30 seconds? I know this is possible by using a DispatcherTimer and then restarting it at PhoneApplicationPage.ManipulationCompleted event? But, I am concerned as this will affect the performance of the application.

Are there any better solutions?

1 Answers1

3

You're on the right track. There isn't an explicit "idle" notification (especially not one that fast).

ManipulationCompleted may not always fire for you since other input can prevent the manipulation from starting and a user could do a very long manipulation. I'd reset the timer on any mouse input rather than just on ManipulationCompleted.

Depending on how exact you need your 30 second timer to be I would consider leaving the timer running and setting a flag for the last input. When the timer expires then check if the flag has been set. This way you won't need to continuously reset the timer for every user input.

Rob Caplan - MSFT
  • 21,714
  • 3
  • 32
  • 54
  • Ohhh! I get it! By setting the flag, you mean controls which provide a way of interaction for the user should raise a flag, once the Task has been completed? –  Nov 08 '14 at 23:22