예제 #1
0
        /// <summary>
        /// 创建消息窗口
        /// </summary>
        /// <param name="msgType">消息类型</param>
        /// <param name="msg">消息内容</param>
        /// <returns></returns>
        private MessageBoxWin CreateMsgWindow(MessageBoxType msgType, string msg)
        {
            MessageBoxWin winResult = new MessageBoxWin();

            winResult.SetMsgBox(msg, msgType);
            if (Application.Current.MainWindow.GetType() == typeof(Shell) &&
                Application.Current.MainWindow.IsVisible)
            {
                winResult.Owner = Application.Current.MainWindow;
            }
            return(winResult);
        }
예제 #2
0
        /// <summary>
        /// 创建消息窗口
        /// </summary>
        /// <param name="title">消息窗口标题</param>
        /// <param name="msg">消息内容</param>
        /// <returns></returns>
        private MessageBoxWin CreateMsgWindow(string title, string msg)
        {
            MessageBoxWin winResult = new MessageBoxWin();

            winResult.SetMsgBox(title, msg);
            if (Application.Current.MainWindow.GetType() == typeof(Shell) &&
                Application.Current.MainWindow.IsVisible)
            {
                winResult.Owner = Application.Current.MainWindow;
            }
            winResult.Topmost = true;
            return(winResult);
        }