locked
Detect when app is idle or in background and when it is closed RRS feed

  • Question

  • What is the code used to check if the user is not working on the application (idle/in background) and when he closes it (alt F4)?

    I am working with windows app with C#

    Tuesday, March 5, 2013 10:24 AM

Answers

  • most close you can get is this Suspending event at the App instance:

    App.Current.Suspending

    and for leaving the app you can use:

    Window.Current.VisibilityChanged

    or

    Window.Current.Closed


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#


    • Edited by Dave SmitsMVP Tuesday, March 5, 2013 10:29 AM
    • Marked as answer by Aaron Xue Wednesday, March 27, 2013 9:09 AM
    Tuesday, March 5, 2013 10:28 AM