终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

49 lines
1.7 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Shapes;
  15. namespace BPASmartClient.CustomResource.Pages.View
  16. {
  17. /// <summary>
  18. /// MainView.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class MainView : Window
  21. {
  22. public string TitleName { get { return _mTitleName; } set { _mTitleName = value; this.tbTitle.Text = value; } }
  23. private string _mTitleName;
  24. public MainView()
  25. {
  26. InitializeComponent();
  27. this.WindowState = WindowState.Maximized;
  28. this.ButMin.Click += (o, e) => { this.WindowState = WindowState.Minimized; };
  29. this.ButMax.Click += (o, e) => { this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; };
  30. this.ButClose.Click += (o, e) => { this.Close(); Application.Current.Shutdown(); };
  31. this.MoveBorder.MouseLeftButtonDown += (o, e) =>
  32. {
  33. if (e.ClickCount > 1)
  34. {
  35. if (this.WindowState == WindowState.Maximized)
  36. this.WindowState = WindowState.Normal;
  37. else if (this.WindowState == WindowState.Normal)
  38. this.WindowState = WindowState.Maximized;
  39. }
  40. if (e.LeftButton == MouseButtonState.Pressed) this.DragMove();
  41. };
  42. }
  43. }
  44. }