1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 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
- {
- /// <summary>
- /// MessageWindowBig.xaml 的交互逻辑
- /// </summary>
- 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;
- }
- }
- /// <summary>
- /// 显示提示窗口
- /// </summary>
- 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;
- }
- }
- }
|