diff --git a/SlnMesnac.WPF/UserControls/ExecutePage.xaml b/SlnMesnac.WPF/UserControls/ExecutePage.xaml
index c24b9c5..9569b2e 100644
--- a/SlnMesnac.WPF/UserControls/ExecutePage.xaml
+++ b/SlnMesnac.WPF/UserControls/ExecutePage.xaml
@@ -239,7 +239,19 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
public ICommand ProductionReportCommand { get; private set; }
+ ///
+ /// 工艺信息命令
+ ///
+ public ICommand TechnologicalInformationCommand { get; private set; }
+
///
/// 执行命令
///
@@ -89,6 +94,7 @@ namespace SlnMesnac.WPF.ViewModel
StationCode = configuration.GetSection("AppConfig")["ProductLineCode"];
HandoverCommand = new RelayCommand(Handover);
ProductionReportCommand = new RelayCommand(ProductionReport);
+ TechnologicalInformationCommand = new RelayCommand(TechnologicalInformation);
SearchCommand = new RelayCommand(Search);
ExecuteCommand = new RelayCommand(Execute);
ProductionReportViewModel.RefreshDelegateEvent += Refresh;
@@ -101,8 +107,10 @@ namespace SlnMesnac.WPF.ViewModel
private void Handover()
{
var handOverWin = new HandOverWin();
+ handOverWin.Owner = Application.Current.MainWindow; // 设置父窗口为当前主窗口
handOverWin.WindowStartupLocation = WindowStartupLocation.CenterScreen; // 让窗体出现在屏幕中央
handOverWin.ShowDialog();//窗体出现后禁止后面的用户控件
+
}
///
@@ -111,10 +119,31 @@ namespace SlnMesnac.WPF.ViewModel
private void ProductionReport()
{
var reportWin = new ProductionReportWin();
+ reportWin.Owner = Application.Current.MainWindow; // 设置父窗口为当前主窗口
reportWin.WindowStartupLocation = WindowStartupLocation.CenterScreen; // 让窗体出现在屏幕中央
reportWin.ShowDialog();//窗体出现后禁止后面的用户控件
}
+ ///
+ /// 工艺信息弹窗,单例模式保证只显示一个
+ ///
+ private static TechnologicalWin instance;
+ private void TechnologicalInformation()
+ {
+ if (instance == null)
+ {
+ instance = new TechnologicalWin();
+ instance.WindowStartupLocation = WindowStartupLocation.CenterScreen;
+ instance.Closed += (sender, e) => { instance = null; }; // 窗口关闭时重置instance为null,以便下次可以重新打开窗口
+ instance.Show();
+ }
+ else
+ {
+ instance.Focus(); // 如果窗口已经存在,则将焦点放在该窗口上
+ }
+ }
+
+
///
/// 检索事件
///
diff --git a/SlnMesnac.WPF/ViewModel/TechnologicalViewModel.cs b/SlnMesnac.WPF/ViewModel/TechnologicalViewModel.cs
new file mode 100644
index 0000000..2dbace7
--- /dev/null
+++ b/SlnMesnac.WPF/ViewModel/TechnologicalViewModel.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SlnMesnac.WPF.ViewModel
+{
+ public class TechnologicalViewModel : INotifyPropertyChanged
+ {
+ ///
+ /// 按钮文字转换事件
+ ///
+ public event PropertyChangedEventHandler PropertyChanged = delegate { };
+
+ public TechnologicalViewModel()
+ {
+ Information1 = "001";
+ Information2 = "002";
+ Information3 = "003";
+ Information4 = "004";
+ Information5 = "005";
+ }
+
+
+ #region
+ ///
+ /// 信息1
+ ///
+ private string information1;
+ public string Information1
+ {
+ get { return information1; }
+ set { information1 = value; OnPropertyChanged("Information1"); }
+ }
+
+ ///
+ /// 信息2
+ ///
+ private string information2;
+ public string Information2
+ {
+ get { return information2; }
+ set { information2 = value; OnPropertyChanged("Information2"); }
+ }
+
+ ///
+ /// 信息3
+ ///
+ private string information3;
+ public string Information3
+ {
+ get { return information3; }
+ set { information3 = value; OnPropertyChanged("Information3"); }
+ }
+
+ ///
+ /// 信息4
+ ///
+ private string information4;
+ public string Information4
+ {
+ get { return information4; }
+ set { information4 = value; OnPropertyChanged("Information4"); }
+ }
+
+ ///
+ /// 信息5
+ ///
+ private string information5;
+ public string Information5
+ {
+ get { return information5; }
+ set { information5 = value; OnPropertyChanged("Information5"); }
+ }
+ #endregion
+ public void OnPropertyChanged([CallerMemberName] string propertyName = "")
+ {
+ PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
diff --git a/SlnMesnac.WPF/Views/TechnologicalWin.xaml b/SlnMesnac.WPF/Views/TechnologicalWin.xaml
new file mode 100644
index 0000000..8b7f979
--- /dev/null
+++ b/SlnMesnac.WPF/Views/TechnologicalWin.xaml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SlnMesnac.WPF/Views/TechnologicalWin.xaml.cs b/SlnMesnac.WPF/Views/TechnologicalWin.xaml.cs
new file mode 100644
index 0000000..00daaa8
--- /dev/null
+++ b/SlnMesnac.WPF/Views/TechnologicalWin.xaml.cs
@@ -0,0 +1,29 @@
+using SlnMesnac.WPF.ViewModel;
+using System;
+using System.Collections.Generic;
+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;
+
+namespace SlnMesnac.WPF.Views
+{
+ ///
+ /// TechnologicalWin.xaml 的交互逻辑
+ ///
+ public partial class TechnologicalWin : Window
+ {
+ public TechnologicalWin()
+ {
+ InitializeComponent();
+ this.DataContext = new TechnologicalViewModel();
+ }
+ }
+}