protected async override void OnNavigatedTo(NavigationEventArgs e) { AppService.SetAppViewBackButtonVisibility(true); SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; UiService.HideStatusBar(); var parameters = NavigateService.GetNavigationObject(e.Parameter).Parameters; _parentFolder = parameters[NavigationParamType.Data] as FolderViewModel; if (_parentFolder == null) { // If something went wrong, disables the command bars this.TopCommandBar.IsEnabled = false; this.BottomCommandBar.IsEnabled = false; await DialogService.ShowAlertAsync( ResourceService.AppMessages.GetString("AM_PreviewImageFailed_Title"), ResourceService.AppMessages.GetString("AM_PreviewImageInitFailed")); return; } this.ViewModel.Initialize(_parentFolder); base.OnNavigatedTo(e); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); var navObject = NavigateService.GetNavigationObject(e.Parameter); if (navObject == null) { return; } this.ViewModel.ConfirmLink = navObject.Parameters[NavigationParamType.Data] as string; this.ViewModel.Email = navObject.Parameters[NavigationParamType.Email] as string; }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); var navObject = NavigateService.GetNavigationObject(e.Parameter); if (navObject == null) { return; } this.ViewModel.Email = navObject.Parameters[NavigationParamType.Email] as string; this.ViewModel.Password = navObject.Parameters[NavigationParamType.Password] as string; this.ViewModel.FirstName = navObject.Parameters[NavigationParamType.FirstName] as string; this.ViewModel.LastName = navObject.Parameters[NavigationParamType.LastName] as string; }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); this.ViewModel.Initialize(); SettingsService.ReloadSettingsRequested += OnReloadSettingsRequested; var navObj = NavigateService.GetNavigationObject(e.Parameter) as NavigationObject; var navActionType = navObj?.Action ?? NavigationActionType.Default; if (navActionType == NavigationActionType.SecuritySettings) { this.MainPivot.SelectedItem = this.SecurityPivot; } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); this.ViewModel.Initialize(); this.GeneralView.ViewModel.GoToUpgrade += GoToUpgrade; this.GeneralView.ViewModel.GoToAchievements += GoToAchievements; this.StorageAndTransferView.ViewModel.GoToUpgrade += GoToUpgrade; var navObj = NavigateService.GetNavigationObject(e.Parameter) as NavigationObject; var navActionType = navObj?.Action ?? NavigationActionType.Default; if (navActionType == NavigationActionType.Upgrade) { this.MyAccountPivot.SelectedItem = this.UpgradePivot; } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); this.ViewModel.Initialize(App.GlobalListener); this.ViewModel.CloudDrive.FolderNavigatedTo += OnFolderNavigatedTo; this.ViewModel.RubbishBin.FolderNavigatedTo += OnFolderNavigatedTo; var navObj = NavigateService.GetNavigationObject(e.Parameter) as NavigationObject; var navActionType = navObj?.Action ?? NavigationActionType.Default; if (navActionType == NavigationActionType.RubbishBin) { this.MainPivot.SelectedItem = this.RubbishBinPivot; } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); this.ContentFrame.Navigated += ContentFrameOnNavigated; SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; var navObj = NavigateService.GetNavigationObject(e.Parameter) as NavigationObject; var navActionType = navObj?.Action ?? NavigationActionType.Default; // Check if the user has an active and online session, because this is the first page loaded if (!await AppService.CheckActiveAndOnlineSessionAsync(true)) { return; } // Check if the user has an active internet connection if (!NetworkService.HasInternetAccess()) { // If not active internet connection, navigate to the offline section NavigateService.Instance.Navigate(typeof(SavedForOfflinePage)); return; } // If user has an active and online session but is not logged in, resume the session if (!Convert.ToBoolean(SdkService.MegaSdk.isLoggedIn())) { if (!await this.ViewModel.FastLoginAsync()) { return; } } this.ViewModel.Initialize(navActionType); if (DebugService.DebugSettings.IsDebugMode && DebugService.DebugSettings.ShowDebugAlert) { DialogService.ShowDebugModeAlert(); } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); // Do not allow user to go back to any previous page NavigateService.CoreFrame.BackStack.Clear(); AppService.SetAppViewBackButtonVisibility(false); // If exists a navigation object if (e?.Parameter != null) { var navObj = NavigateService.GetNavigationObject(e.Parameter); NavigationActionType navActionType = navObj.Action; // Try to avoid display duplicate alerts if (isAlertAlreadyDisplayed) { return; } isAlertAlreadyDisplayed = true; switch (navActionType) { case NavigationActionType.Login: this.ViewModel.LoginViewModel.Email = navObj.Parameters[NavigationParamType.Email] as string; await DialogService.ShowAlertAsync( ResourceService.AppMessages.GetString("AM_AlreadyConfirmedAccount_Title"), ResourceService.AppMessages.GetString("AM_AlreadyConfirmedAccount")); break; case NavigationActionType.Recovery: this.ViewModel.LoginViewModel.Email = navObj.Parameters[NavigationParamType.Email] as string; this.ViewModel.LoginViewModel.Password = navObj.Parameters[NavigationParamType.Password] as string; break; case NavigationActionType.API_ESID: // Show a message notifying the error await DialogService.ShowAlertAsync( ResourceService.AppMessages.GetString("AM_SessionIDError_Title"), ResourceService.AppMessages.GetString("AM_SessionIDError")); break; case NavigationActionType.API_EBLOCKED: string message; switch ((AccountBlockedReason)navObj.Parameters[NavigationParamType.Number]) { case AccountBlockedReason.Copyright: message = ResourceService.AppMessages.GetString("AM_AccountBlockedCopyright"); break; case AccountBlockedReason.OtherReason: default: message = ResourceService.AppMessages.GetString("AM_AccountBlocked"); break; } // Show a message notifying the error await DialogService.ShowAlertAsync( ResourceService.AppMessages.GetString("AM_AccountBlocked_Title"), message); break; } isAlertAlreadyDisplayed = false; } if (DebugService.DebugSettings.IsDebugMode && DebugService.DebugSettings.ShowDebugAlert) { DialogService.ShowDebugModeAlert(); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); this.ViewModel.RecoveryKey = NavigateService.GetNavigationObject(e.Parameter).Parameters[NavigationParamType.Data] as string; }