Activated and Deactivated events on WP8

WP8 has so many limitations that this was the only nice way to get it working.