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 NEIntelligentControl2
{
///
/// 提示窗口
///
public partial class MessageWindow : Window
{
public string Message { get; set; }
public MessageWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
switch (((Control)sender).Tag)
{
case "cancel": // 取消
DialogResult = false;
break;
case "ok": // 确认
DialogResult = true;
break;
default: return;
}
}
///
/// 显示提示窗口
///
public static bool ShowMessage(string message, string title = "提示")
{
MessageWindow mw = new MessageWindow() { Message = message, Title = title };
mw.Owner = Application.Current.MainWindow;
var v = mw.ShowDialog();
return v == true;
}
}
}