void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e) { if (e.Visible) { AppDatabase.Current.LoadInstances(); //_startAll(); NavigationService.NavigateOnUI("FlickrLoginView"); } else { AppDatabase.Current.Unload(); RenderingService.Unload(); _stopAll(); NavigationService.NavigateOnUI("SuspendedView"); } }
private void _cleanUpAll() { pbMainLoading.IsActive = false; ccDrawingSurfaceBottom.Content = null; ccDrawingSurfaceTop.Content = null; RenderingService.Unload(); GestureService.Stop(this); SettingsPane.GetForCurrentView().CommandsRequested -= _vm.onCommandsRequested; GestureService.OnGestureRaised -= GestureService_OnGestureRaised; //SearchPane.GetForCurrentView().QuerySubmitted -= _vm.onQuerySubmitted; flickrLoggedInUser.LogoutRequested -= flickrLoggedInUser_LogoutRequested; flickrLoggedInUser.UnloadControl(); flickrPublicFavourites.UnloadControl(); flickrPromoted.UnloadControl(); flickrPicture.UnloadControl(); flickrPictureToolbar.UnloadControl(); flickrSmallList.UnloadControl(); _fvm.ChangeState -= _fvm_ChangeState; DownloadService.Current.DownloadCountChanged -= Current_DownloadCountChanged; //Messenger.Default.Unregister<GeneralSystemWideMessage>(this, DoGeneralSystemWideMessageCallback); //_fvm.Unload(); //_vm = null; //_fvm = null; }
void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) { _stopAll(); AppDatabase.Current.Unload(); RenderingService.Unload(); }