How can I register an OnExit Event for my Windows Phone 8 app to do some tasks before user exits Application.

I tried using:

```
Application.Current.Exit

```

But Visual Studio says it wont be called for Windows Phone.
Any Help?

Thanks