public static bool?ShowDialog2(string title, string content, string btn1Content = "确定", string btn2Content = "取消") { WinDialog win = new WinDialog(title, content, btn1Content, btn2Content); win.Owner = Application.Current.MainWindow; win.ShowDialog(); return(win.DialogResult); }
public static bool?ShowDialogRightPos(string title, string content, string btn1Content = "确定", string btn2Content = "取消") { WinDialog win = new WinDialog(title, content, btn1Content, btn2Content); win.Owner = Application.Current.MainWindow; win.WindowStartupLocation = WindowStartupLocation.Manual; win.Left = 1400; win.Top = 400; win.ShowDialog(); return(win.DialogResult); }
private void DialogTask() { for (; ;) { App.Current.Dispatcher?.Invoke(() => { WinDialog.ShowDialog2("tip", "abc"); }); Thread.Sleep(100); } }
private void InvokeTest() { Thread.Sleep(1000); WinDialog.ShowDialog2("abc", "123"); }