MainWnd.xaml.cs 1.6 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. using RR2.Class;
  16. using RR2.UI.Pages;
  17. namespace RR2.UI.Views
  18. {
  19. /// <summary>
  20. /// Логика взаимодействия для MainWindow.xaml
  21. /// </summary>
  22. public partial class MainWnd : Window
  23. {
  24. public MainWnd()
  25. {
  26. InitializeComponent();
  27. Frames.MainFrame = MainFr;
  28. Frames.MainFrame.Navigate(new OrgStructurePg());
  29. this.Show();
  30. }
  31. // Перетаскивание формы
  32. private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  33. {
  34. this.DragMove();
  35. }
  36. // Кнопки скрытия,свертывания и закрытия
  37. private void CloseBtn_Click(object sender, RoutedEventArgs e)
  38. {
  39. Close();
  40. }
  41. private void RestoreBtn_Click(object sender, RoutedEventArgs e)
  42. {
  43. if (WindowState == WindowState.Normal)
  44. WindowState = WindowState.Maximized;
  45. else
  46. WindowState = WindowState.Normal;
  47. }
  48. private void MinimizeBtn_Click(object sender, RoutedEventArgs e)
  49. {
  50. WindowState = WindowState.Minimized;
  51. }
  52. }
  53. }