private void HistoryButton_Click(object sender, RoutedEventArgs e) { if (App.CurrentUserLogin != null) { try { App.PersonInformation = DatabaseInteraction.PeopleFromDb.GetFoundPeople(App.CurrentUserLogin).Distinct().ToList(); } catch { App.PersonInformation = new List <FindPeople.PersonInformation>(); MessageBox.Show("Не удалось загрузить историю."); return; } for (int i = 0; i < App.PersonInformation.Count; i++) { App.PersonInformation[i].RemoveNulls(); } if (App.PersonInformation.Count < 1) { MessageBox.Show("История пуста."); return; } else { PagesFrame.Navigate(new Uri("ListOfPeoplePage.xaml", UriKind.Relative)); } } else { MessageBox.Show("Для просмотра истории поиска нужно авторизироваться."); } }
private void Navigate_Delete(object sender, RoutedEventArgs e) { try { string path = (string)Application.Current.Properties["path"]; if (path.Length > 0) { PagesFrame.Navigate(new Uri("/pages/DeletePage.xaml", UriKind.Relative)); } } catch { MessageBox.Show("Error: Select a project to delete it.", "Error: File Select", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void BackButton_Click(object sender, RoutedEventArgs e) { if (PagesFrame.CanGoBack) { bool isAuthPage = PagesFrame.Source.ToString().Contains("RegistrationPage.xaml") || PagesFrame.Source.ToString().Contains("QuestionPage.xaml") || PagesFrame.Source.ToString().Contains("MainWindow.xaml") || PagesFrame.Source.ToString().Contains("ForgottenPasswordPage.xaml") || PagesFrame.Source.ToString().Contains("ChangePasswordPage.xaml") || PagesFrame.Source.ToString().Contains("AuthorizationPage.xaml"); if (!isAuthPage) { PagesFrame.GoBack(); } else if (PagesFrame.Source.ToString().Contains("MainWindow.xaml")) { return; } else { PagesFrame.Navigate(new Uri("InputPage.xaml", UriKind.Relative)); } } }
private void NavigateToProgress() { PagesFrame.Navigate(typeof(ProgressPage)); SetTitle("Progress"); }
private void NavigateToPractice() { PagesFrame.Navigate(typeof(PracticePage)); SetTitle("Practice"); }
private void NavigateToTutorial() { PagesFrame.Navigate(typeof(TutorialPage)); SetTitle("Tutorial"); }
private void NavigateToHome() { PagesFrame.Navigate(typeof(HomePage)); SetTitle("Home"); }
private void Navigate_PathSettings(object sender, RoutedEventArgs e) { PagesFrame.Navigate(new Uri("/pages/PathSettings.xaml", UriKind.Relative)); //change Uri }
private void LoginButton_Click(object sender, RoutedEventArgs e) { PagesFrame.Navigate(new Uri("AuthorizationPage.xaml", UriKind.Relative)); }