1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
| using System.Windows;
| using System.Windows.Input;
|
| namespace XHandler.View.About
| {
| /// <summary>
| /// 系统信息页面
| /// </summary>
| public partial class SystemInformation : Window
| {
| #region 初始化
| /// <summary>
| /// 构造函数
| /// </summary>
| public SystemInformation()
| {
| InitializeComponent(); // 不要忘记这一句!
| }
|
| private void Window_Loaded(object sender, RoutedEventArgs e)
| {
| // 你的初始化代码
| }
|
| private void Window_PreviewKeyDown(object sender, KeyEventArgs e) // 注意参数是 KeyEventArgs
| {
| // 处理键盘事件,比如 ESC 键关闭窗口等
| if (e.Key == Key.Escape)
| {
| this.Close();
| }
| }
|
| private void btnClose_Click(object sender, RoutedEventArgs e)
| {
| this.Close();
| }
|
|
| #endregion
|
|
| }
| }
|
|