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
{
///
/// DeviceManagermentSetView.xaml 的交互逻辑
///
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((s) =>
{
this.Tag = s;
this.DialogResult = false;
DelegationNotifi.GetInstance.Cancel = null;
this.Close();
});
DelegationNotifi.GetInstance.Confirm = new Action((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();
}
}
}