locked
How to get application close by user event in metro apps?

    Question

  • Hi,

    I  have created a metro application to control a device. I would like to shut down the device when the user closes the metro application. Is there any way to get the user close event? (application suspend event is not enough to handle this scenario as it may fire when the user temporarily switches to another application).

    Thanks & Regards,

    Mathews

    Monday, April 21, 2014 3:08 PM

Answers

  • no there isnt a closed event. this because when you close an app it isnt really closing just suspending

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Monday, April 21, 2014 3:17 PM
  • You'll need to do this on suspend if shutting down the app is important. On Visible changed may be better. Even if the user just switches away there's is no guarantee that the user will come back to your app. Once suspended the app won't get any further events or notifications (unless resumed). It may be terminated at any time.
    Monday, April 21, 2014 3:25 PM
    Owner

All replies

  • no there isnt a closed event. this because when you close an app it isnt really closing just suspending

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Monday, April 21, 2014 3:17 PM
  • You'll need to do this on suspend if shutting down the app is important. On Visible changed may be better. Even if the user just switches away there's is no guarantee that the user will come back to your app. Once suspended the app won't get any further events or notifications (unless resumed). It may be terminated at any time.
    Monday, April 21, 2014 3:25 PM
    Owner