You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
894 B
C#
32 lines
894 B
C#
using Aucma.Scada.UI.viewModel;
|
|
using System;
|
|
|
|
namespace Aucma.Scada.UI
|
|
{
|
|
/// <summary>
|
|
/// MainWindow.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class MainWindow
|
|
{
|
|
private static readonly Lazy<MainWindow> _instance = new Lazy<MainWindow>(() => new MainWindow());
|
|
|
|
public static MainWindow Instance => _instance.Value;
|
|
|
|
private MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
MainViewModel mainViewModel = new MainViewModel();
|
|
this.DataContext = mainViewModel;
|
|
Closing += PageView_Closing; // 订阅窗口关闭事件
|
|
}
|
|
|
|
private void PageView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
{
|
|
this.Hide();
|
|
//跳转到登录页
|
|
LoginPageView login = LoginPageView.Instance;
|
|
login.Show();
|
|
}
|
|
}
|
|
}
|