Пример #1
0
        public static string Show(string messageBoxText, string caption, MessageBoxImage image, params IMessageBoxWpfButton[] buttons)
        {
            return(Global.InvokeOnGuiThread(() =>
            {
                var form = new MessageBoxWpfWindow(messageBoxText, caption, image, buttons.ToArray());
                form.ShowDialog();

                return form.Result;
            }));
        }
Пример #2
0
        public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxImage image, params MessageBoxResult[] buttons)
        {
            return(Global.InvokeOnGuiThread(() =>
            {
                var form = new MessageBoxWpfWindow(messageBoxText, caption, image, buttons.Select(MessageBoxWpfButton.Create).ToArray());
                form.ShowDialog();

                if (form.Result == null)
                {
                    return MessageBoxResult.None;
                }

                return form.Result.ToEnum <MessageBoxResult>();
            }));
        }