MainWindow.xaml.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace IS31Nabievv
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для MainWindow.xaml
  19. /// </summary>
  20. public partial class MainWindow : Window
  21. {
  22. public MainWindow()
  23. {
  24. InitializeComponent();
  25. }
  26. private void MainFrame_Navigated(object sender, NavigationEventArgs e)
  27. {
  28. }
  29. private void MainFrame_OnNavigated(object sender, NavigationEventArgs e)
  30. {
  31. if (!(e.Content is Page page)) return;
  32. this.Title = $"LESSON - {page.Title}";
  33. if (page is Pages.AuthPage)
  34. {
  35. ButtonBack.Visibility = Visibility.Hidden;
  36. }
  37. else
  38. {
  39. ButtonBack.Visibility = Visibility.Visible;
  40. }
  41. }
  42. private void ButtonBack_OnClick(object sender, RoutedEventArgs e)
  43. {
  44. if(MainFrame.CanGoBack) MainFrame.GoBack();
  45. }
  46. }
  47. }