|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
- using Microsoft.Toolkit.Mvvm.Messaging;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using BPASmart.Model;
-
- namespace BPASmart.VariableManager.Views
- {
- /// <summary>
- /// DeviceManagermentSetView.xaml 的交互逻辑
- /// </summary>
- public partial class NewDeviceView : Window
- {
- public NewDeviceView()
- {
- InitializeComponent();
- this.MoveBorder.MouseLeftButtonDown += (o, e) => { this.DragMove(); };
- this.ButMin.Click += (o, e) => { this.WindowState = WindowState.Minimized; };
- this.ButMax.Click += (o, e) => { this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; };
- this.ButClose.Click += (o, e) => { this.DialogResult = false; };
- this.MaxWidth = SystemParameters.WorkArea.Width;
- this.MaxHeight = SystemParameters.WorkArea.Height;
-
- DelegationNotifi.GetInstance.Cancel = new Action<DeviceManagermentResult>((s) =>
- {
- this.Tag = s;
- this.DialogResult = false;
- DelegationNotifi.GetInstance.Cancel = null;
- this.Close();
- });
-
- DelegationNotifi.GetInstance.Confirm = new Action<DeviceManagermentResult>((s) =>
- {
- this.Tag = s;
- this.DialogResult = true;
- DelegationNotifi.GetInstance.Cancel = null;
- this.Close();
- });
-
- }
-
-
- private void ThisDialogResult(DeviceManagermentResult s, bool result)
- {
- this.Tag = s;
- this.DialogResult = result;
- DelegationNotifi.GetInstance.Cancel = null;
- this.Close();
- }
- }
- }
|