internal void UnloadBase() { Messenger.Default.Unregister<GeneralSystemWideMessage>(this, DoGeneralSystemWideMessageCallback); _fvm.Unload(); _vm = null; _fvm = null; }
internal void OnNavigateToBase(Windows.UI.Core.CoreDispatcher dispatcher) { _vm = new HomeViewModel(); _vm.Load(); _fvm = new FlickrViewModel(Dispatcher); Messenger.Default.Register<GeneralSystemWideMessage>(this, DoGeneralSystemWideMessageCallback); }
protected override void OnNavigatedTo(NavigationEventArgs e) { PopupService.Init(layoutRoot); LoggingService.LogInformation("Showing splash screeen", "Views.HomeView"); _vm = new FlickrViewModel(Dispatcher); _vm.ChangeState += _vm_ChangeState; this.DataContext = _vm; //_vm.ShowLoginCommand.Execute(null); //AppDatabase.Current.DeleteProjects(SessionID); if (_vm.IsFlickrLoginDetailsCached()) { //NavigationService.NavigateOnUI("HomeView"); _vm.ViewInit(); ucLoginOrLoggedIn.LoadDetails(_vm.FullName, _vm.BuddyIconUrl, Controls.Flickr.UserCard.CardPosition.Left); butLoginRequest.Tag = "Loggedin"; } else { ucLoginOrLoggedIn.LoadDetails("Login", "ms-appx:///Assets/FlickrLogin.PNG", Controls.Flickr.UserCard.CardPosition.Left); butLoginRequest.Tag = "Login"; } ucPublic.LoadDetails("Public", "ms-appx:///Assets/FlickrPublic.PNG", Controls.Flickr.UserCard.CardPosition.Right); sbShowCards.Begin(); sbLoadView.Begin(); //NotifyGCTotalMemory(); }
public HomeView() { this.InitializeComponent(); PopupService.Init(layoutRoot); DownloadService.Current.DownloadCountChanged += Current_DownloadCountChanged; layoutRoot.Background = new SolidColorBrush(Colors.Black); LoggingService.LogInformation("Showing splash screeen", "Views.HomeView"); _vm = new HomeViewModel(); _vm.Load(); this.DataContext = _vm; _fvm = new FlickrViewModel(Dispatcher); pbMainLoading.DataContext = _fvm; //_vm.ShowLoginCommand.Execute(null); try { Messenger.Default.Register<GeneralSystemWideMessage>(this, DoGeneralSystemWideMessageCallback); } catch { } GestureService.OnGestureRaised += (o, a) => { CustomGestureArgs gestureArgs = (CustomGestureArgs)a; //NumberFramesToRender += 3; if (gestureArgs.ManipulationStartedArgs != null) { } else if (gestureArgs.ManipulationInertiaStartingArgs != null) { } else if (gestureArgs.ManipulationUpdatedArgs != null) { } else if (gestureArgs.ManipulationCompletedArgs != null) { } else if (gestureArgs.TappedEventArgs != null) { } else if (gestureArgs.PressedPointerRoutedEventArgs != null) { } else if (gestureArgs.MovedPointerRoutedEventArgs != null) { if (_drawLine) { _lineEndPoint = gestureArgs.MovedPointerRoutedEventArgs.GetCurrentPoint(null).Position; drawLine(_lineStartPoint, _lineEndPoint); } } else if (gestureArgs.ReleasedPointerRoutedEventArgs != null) { if (_drawLine) { _drawLine = false; drawLine(_lineStartPoint, _lineStartPoint); performAction(_actionToDo); } } }; //AppDatabase.Current.DeleteProjects(SessionID); AppService.NetworkConnectionChanged += AppService_NetworkConnectionChanged; WindowLayoutService.OnWindowLayoutRaised += WindowLayoutService_OnWindowLayoutRaised; }