MainWindow.xaml.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using PDF_Office.ViewModels;
  2. using Prism.Regions;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace PDF_Office.Views
  18. {
  19. /// <summary>
  20. /// MainWindow.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class MainWindow : Window
  23. {
  24. public HomeContentViewModel HomeViewModel;
  25. public MainWindow()
  26. {
  27. InitializeComponent();
  28. }
  29. private void BtnMiniSize_Click(object sender, RoutedEventArgs e)
  30. {
  31. System.Windows.SystemCommands.MinimizeWindow(this);
  32. }
  33. private void BtnClose_Click(object sender, RoutedEventArgs e)
  34. {
  35. System.Windows.SystemCommands.CloseWindow(this);
  36. }
  37. private void BtnReStore_Click(object sender, RoutedEventArgs e)
  38. {
  39. if (this.WindowState == WindowState.Maximized)
  40. System.Windows.SystemCommands.RestoreWindow(this);
  41. else
  42. System.Windows.SystemCommands.MaximizeWindow(this);
  43. }
  44. private void Window_Activated(object sender, EventArgs e)
  45. {
  46. App.Current.MainWindow = this;
  47. }
  48. }
  49. }