添加项目文件。
This commit is contained in:
50
Main.xaml.cs
Normal file
50
Main.xaml.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
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 ShanghaiEnvironmentalTechnology
|
||||
{
|
||||
/// <summary>
|
||||
/// Main.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class Main : Window
|
||||
{
|
||||
public Main()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string imagePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources/sleep2.jpg");
|
||||
ImageBrush brush = new ImageBrush();
|
||||
brush.ImageSource = new BitmapImage(new Uri(imagePath, UriKind.Absolute));
|
||||
this.Background = brush;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 进入主窗体事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
MainWindow mainWindow = MainWindow.Instance;
|
||||
mainWindow.ShowDialog(); // 显示 MainWindow
|
||||
|
||||
|
||||
this.Close(); // 如果您希望在打开新窗口时关闭当前窗口
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user