예제 #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);
        }
예제 #3
0
        /// <summary>
        /// 显示模式对话框
        /// </summary>
        /// <param name="win"></param>
        /// <returns></returns>
        private bool ShowDialogMsg(MessageBoxWin win)
        {
            var result = win.ShowDialog();

            return(result.HasValue && result.Value);
        }