示例#1
0
        public static bool?Show(string message, string title, bool showCancelButton, DialogWinImage image, UIElement relative)
        {
            DialogWin win   = new DialogWin();
            Window    owner = FindTopWin(relative);

            win.Owner = owner;
            if (owner != null)
            {
                win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            }
            else
            {
                win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            }

            win.ViewModel.Content = message;
            win.ViewModel.Image   = image;
            if (title != null)
            {
                win.ViewModel.Title = title;
            }
            win.ViewModel.ButtonCancelVisible = showCancelButton ? Visibility.Visible : Visibility.Collapsed;
            bool?flag = win.ShowDialog();

            return(flag);
        }
示例#2
0
 public static void ShowError(string err)
 {
     DialogWin.Show(err, DialogWinImage.Error);
 }
示例#3
0
 public static void ShowWarning(string warning)
 {
     DialogWin.Show(warning, DialogWinImage.Warning);
 }
示例#4
0
 public static void ShowMessage(string msg)
 {
     DialogWin.Show(msg);
 }