An in-window MessageBox replacment when using ModernWPF.
Inheritance: MessageBoxControl
コード例 #1
0
        /// <summary>
        /// Displays a message box in front of the specified <see cref="DialogControlContainer" />.
        /// </summary>
        /// <param name="owner">A <see cref="DialogControlContainer" /> to host this message box.</param>
        /// <param name="messageBoxText">The message box text.</param>
        /// <param name="caption">The caption.</param>
        /// <param name="button">The button to display.</param>
        /// <param name="icon">The icon to display.</param>
        /// <param name="defaultResult">The default result.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">owner</exception>
        public static MessageBoxResult Show(DialogControlContainer owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult)
        {
            if (owner == null) { throw new ArgumentNullException("owner"); }

            var diag = new ModernMessageBox();
            diag.txtMsg.Text = messageBoxText;
            return diag.ShowDialogModal(owner, caption, button, icon, defaultResult);
        }