protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); // Attach handlers for suspension to stop the watcher when the App is suspended. App.Current.Suspending += App_Suspending; App.Current.Resuming += App_Resuming; }