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

64 line
2.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  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. using Microsoft.Toolkit.Mvvm.Messaging;
  16. using Microsoft.Toolkit.Mvvm.ComponentModel;
  17. using BPASmart.Model;
  18. namespace BPASmart.VariableManager.Views
  19. {
  20. /// <summary>
  21. /// DeviceManagermentSetView.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class NewDeviceView : Window
  24. {
  25. public NewDeviceView()
  26. {
  27. InitializeComponent();
  28. this.MoveBorder.MouseLeftButtonDown += (o, e) => { this.DragMove(); };
  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) => { this.DialogResult = false; };
  32. this.MaxWidth = SystemParameters.WorkArea.Width;
  33. this.MaxHeight = SystemParameters.WorkArea.Height;
  34. DelegationNotifi.GetInstance.Cancel = new Action<DeviceManagermentResult>((s) =>
  35. {
  36. this.Tag = s;
  37. this.DialogResult = false;
  38. DelegationNotifi.GetInstance.Cancel = null;
  39. this.Close();
  40. });
  41. DelegationNotifi.GetInstance.Confirm = new Action<DeviceManagermentResult>((s) =>
  42. {
  43. this.Tag = s;
  44. this.DialogResult = true;
  45. DelegationNotifi.GetInstance.Cancel = null;
  46. this.Close();
  47. });
  48. }
  49. private void ThisDialogResult(DeviceManagermentResult s, bool result)
  50. {
  51. this.Tag = s;
  52. this.DialogResult = result;
  53. DelegationNotifi.GetInstance.Cancel = null;
  54. this.Close();
  55. }
  56. }
  57. }