69 lines
1.6 KiB
C#
69 lines
1.6 KiB
C#
|
|
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;
|
|||
|
|
using 建材不燃性试验炉;
|
|||
|
|
|
|||
|
|
namespace jiancaiburanxing
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// TestReportWindow.xaml 的交互逻辑
|
|||
|
|
/// </summary>
|
|||
|
|
public partial class TestReportWindow : Window
|
|||
|
|
{
|
|||
|
|
#region 构造函数和初始化
|
|||
|
|
public TestReportWindow()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 切换主页相关
|
|||
|
|
|
|||
|
|
private MainWindow _mainWindow;
|
|||
|
|
|
|||
|
|
//返回
|
|||
|
|
private void btnReturn_Click(object sender, RoutedEventArgs e)
|
|||
|
|
{
|
|||
|
|
SwitchWindow(ref _mainWindow, () => new MainWindow());
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void SwitchWindow<T>(ref T windowInstance, Func<T> createFunc) where T : Window, new()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (windowInstance == null)
|
|||
|
|
{
|
|||
|
|
windowInstance = createFunc();
|
|||
|
|
// 添加窗口关闭事件处理
|
|||
|
|
windowInstance.Closed += (s, args) =>
|
|||
|
|
{
|
|||
|
|
this.Show();
|
|||
|
|
this.Activate();
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
windowInstance.Activate();
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.Hide();
|
|||
|
|
windowInstance.Show();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|