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 Button_Click(object sender, RoutedEventArgs e)
        {
            string text = (sender as Button).Content.ToString();

            switch (text)
            {
            case "Attractions":
            case "Cities":
            case "Countries":
            case "Hotels":
            case "Pictures":
            case "Tours":
            {
                PagesFrame.Source = new Uri($"Pages/{text}Page.xaml", UriKind.Relative);
                TbPage.Text       = $"{text} page";
                TbPage.Visibility = Visibility.Visible;
                PagesFrame.Focus();
                break;
            }

            default:
                break;
            }
        }
Exemple #5
0
 private void NavigateToProgress()
 {
     PagesFrame.Navigate(typeof(ProgressPage));
     SetTitle("Progress");
 }
Exemple #6
0
 private void NavigateToPractice()
 {
     PagesFrame.Navigate(typeof(PracticePage));
     SetTitle("Practice");
 }
Exemple #7
0
 private void NavigateToTutorial()
 {
     PagesFrame.Navigate(typeof(TutorialPage));
     SetTitle("Tutorial");
 }
Exemple #8
0
 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));
 }