/// <summary>
        /// Shows a new <see cref="MessageWindowElement"/> with the given caption, message and buttons
        /// </summary>
        /// <param name="caption"></param>
        /// <param name="message"></param>
        /// <param name="buttons"></param>
        /// <returns></returns>
        public static DialogResult Show(string caption, string message, DialogButton buttons)
        {
            lock (SyncObject)
            {
                DialogResult result = DialogResult.None;

                System.Windows.Application.Current.Dispatcher.Invoke(
                    (Action) delegate
                {
                    MessageWindowElement window = new MessageWindowElement
                    {
                        Title           = caption,
                        Content         = message,
                        Buttons         = buttons,
                        StartupLocation = StartupPosition.CenterParent
                    };

                    result = ServiceLocator.GetService <IVirtualDesktopManager>().ShowDialog(window);
                });

                return(result);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Shows a new <see cref="MessageWindowElement"/> with the given caption, message and buttons
        /// </summary>
        /// <param name="caption"></param>
        /// <param name="message"></param>
        /// <param name="buttons"></param>
        /// <returns></returns>
        public static DialogResult Show(string caption, string message, DialogButton buttons)
        {
            lock (SyncObject)
            {
                DialogResult result = DialogResult.None;

                System.Windows.Application.Current.Dispatcher.Invoke(
                    (Action)delegate
                    {
                        MessageWindowElement window = new MessageWindowElement
                        {
                            Title           = caption,
                            Content         = message,
                            Buttons         = buttons,
                            StartupLocation = StartupPosition.CenterParent
                        };

                        result = ServiceLocator.GetService<IVirtualDesktopManager>().ShowDialog(window);
                    });

                return result;
            }
        }
 /// <summary>
 /// Shows a new <see cref="MessageWindowElement"/> with the given message
 /// </summary>
 /// <param name="message"></param>
 /// <returns></returns>
 public static DialogResult Show(string message)
 {
     return(MessageWindowElement.Show("Message", message, DialogButton.OkCancel));
 }