schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using DataEntity.Share;
using System;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;
using XCommon.Log;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
 
namespace XHandler.View.Dialog
{
    /// <summary>
    /// 消息窗体
    /// </summary>
    public partial class MessageDialog : Window
    {
        #region 构造函数
        public MessageDialog(string msg)
        {
            InitializeComponent();
            textblockMsg.Text = msg;
            this.Owner = (Window)Shared.Main;
        }
        #endregion
 
        #region 初始化
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
            }
            catch (Exception ex)
            {
                LoggerHelper.ErrorLog("ERROR:", ex);
            }
        }
        #endregion
 
        #region 关闭页面
        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
        #endregion
 
        #region 拖动窗体
        /// <summary>
        /// 拖动窗体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
            {
                this.DragMove();
            }
        }
        #endregion
 
        #region ESC关闭画面
        /// <summary>
        /// ESC关闭画面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
            {
                this.Close();
            }
        }
        #endregion
    }
}