终端一体化运控平台
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.
 
 
 

57 lines
1.9 KiB

  1. using BPASmartClient.CustomResource.Pages.Model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Reflection;
  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.Shapes;
  16. namespace BPASmartClient.CustomResource.Pages.View
  17. {
  18. /// <summary>
  19. /// MainView.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class MainView : Window
  22. {
  23. public string TitleName { get { return _mTitleName; } set { _mTitleName = value; this.tbTitle.Text = value; } }
  24. private string _mTitleName;
  25. public MainView()
  26. {
  27. InitializeComponent();
  28. this.WindowState = WindowState.Maximized;
  29. this.ButMin.Click += (o, e) => { this.WindowState = WindowState.Minimized; };
  30. this.ButMax.Click += (o, e) => { this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; };
  31. this.ButClose.Click += (o, e) =>
  32. {
  33. if (MessageNotify.GetInstance.ShowDialog("确认关闭上位机?", DialogType.Warning))
  34. {
  35. this.Close();
  36. Application.Current.Shutdown();
  37. }
  38. };
  39. this.MoveBorder.MouseLeftButtonDown += (o, e) =>
  40. {
  41. if (e.ClickCount > 1)
  42. {
  43. if (this.WindowState == WindowState.Maximized)
  44. this.WindowState = WindowState.Normal;
  45. else if (this.WindowState == WindowState.Normal)
  46. this.WindowState = WindowState.Maximized;
  47. }
  48. if (e.LeftButton == MouseButtonState.Pressed) this.DragMove();
  49. };
  50. }
  51. }
  52. }