ShowDialog() public method

Display the MessageBox window and returns only when this MessageBox closes.
public ShowDialog ( ) : bool?
return bool?
        private void OnStyleableWindow_Click(object sender, RoutedEventArgs e)
        {
            var msgBox = new Xceed.Wpf.Toolkit.MessageBox();

            msgBox.DataContext = this.DataContext;
            msgBox.Text        = StyleableWindowMessage;
            msgBox.Caption     = StyledMsgBoxTitle;
            msgBox.Style       = (_enableStyleCheckBox.IsChecked.GetValueOrDefault()) ? ( Style )this.Resources[MessageBoxStyleKey] : null;
            msgBox.ShowDialog();
        }
    private void OnStylableWindow_Click( object sender, RoutedEventArgs e )
    {
      var msgBox = new Xceed.Wpf.Toolkit.MessageBox();
      msgBox.DataContext = this.DataContext;
      msgBox.Text = StylableWindowMessage;
      msgBox.Caption = StyledMsgBoxTitle;
      msgBox.Style = ( _enableStyleCheckBox.IsChecked.GetValueOrDefault() ) ? ( Style )this.Resources[ MessageBoxStyleKey ] : null;
      msgBox.ShowDialog();



    }
        /// <summary>
        /// Shows the MessageBox.
        /// </summary>
        /// <param name="messageText">The message text.</param>
        /// <param name="caption">The caption.</param>
        /// <param name="button">The button.</param>
        /// <param name="icon">The icon.</param>
        /// <param name="defaultResult">The default result.</param>
        /// <returns></returns>
        private static MessageBoxResult ShowCore(Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, Style messageBoxStyle)
        {
            if (System.Windows.Interop.BrowserInteropHelper.IsBrowserHosted)
            {
                throw new InvalidOperationException("Static methods for MessageBoxes are not available in XBAP. Use the instance ShowMessageBox methods instead.");
            }

            MessageBox msgBox = new MessageBox();

            msgBox.InitializeMessageBox(owner, messageText, caption, button, icon, defaultResult);

            // Setting the style to null will inhibit any implicit styles
            if (messageBoxStyle != null)
            {
                msgBox.Style = messageBoxStyle;
            }

            msgBox.ShowDialog();
            return(msgBox.MessageBoxResult);
        }
    /// <summary>
    /// Shows the MessageBox.
    /// </summary>
    /// <param name="messageText">The message text.</param>
    /// <param name="caption">The caption.</param>
    /// <param name="button">The button.</param>
    /// <param name="icon">The icon.</param>
    /// <param name="defaultResult">The default result.</param>
    /// <returns></returns>
    private static MessageBoxResult ShowCore( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, Style messageBoxStyle )
    {
      if( System.Windows.Interop.BrowserInteropHelper.IsBrowserHosted )
      {
        throw new InvalidOperationException( "Static methods for MessageBoxes are not available in XBAP. Use the instance ShowMessageBox methods instead." );
      }

      MessageBox msgBox = new MessageBox();
      msgBox.InitializeMessageBox( owner, messageText, caption, button, icon, defaultResult );

      // Setting the style to null will inhibit any implicit styles      
      if( messageBoxStyle != null )
      {
        msgBox.Style = messageBoxStyle;
      }

      msgBox.ShowDialog();
      return msgBox.MessageBoxResult;
    }