Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        private void DialogTask()
        {
            for (; ;)
            {
                App.Current.Dispatcher?.Invoke(() =>
                {
                    WinDialog.ShowDialog2("tip", "abc");
                });

                Thread.Sleep(100);
            }
        }
Exemple #4
0
        private void InvokeTest()
        {
            Thread.Sleep(1000);

            WinDialog.ShowDialog2("abc", "123");
        }