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.Windows { /// /// MessageWindowBig.xaml 的交互逻辑 /// public partial class MessageWindowBig : Window { public string Message { get; set; } public MessageWindowBig() { 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 = "提示") { MessageWindowBig mw = new MessageWindowBig() { Message = message, Title = title }; mw.Owner = Application.Current.MainWindow; var v = mw.ShowDialog(); return v == true; } } }