I'm working on porting an app from iOS to WinRT/8 Metro/8 Immersive/Whatever the current name is.
On iOS, we have the ability to set Application does not run in background
to YES
to cause the app to actually quit whenever the user leaves the app.
I would like to figure out how to replicate this behavior in WinRT.
- Yes, I understand that this is abnormal behavior.
- Yes, I have thought this through.
- Yes, I have an extremely good reason for doing this.
I'm assuming that during the userLeavingApp
event, I would just call Application.Current.Exit()
, but I can't seem to find the userLeavingApp
event. I thought about using OnSuspending
(Handles Me.Suspending) in App.xaml.vb, but that doesn't seem to be called quickly enough for me.
Is there a .NET equivalent of viewWillDisappear
or something?
Any ideas? This is an important security characteristic of my app, and I'd hate to have such difficulty in an entire platform due to such a small issue.
Thanks!