Xceed.Wpf.Toolkit.MessageBox.ShowCore C# (CSharp) Method

ShowCore() private static method

Shows the MessageBox.
private static ShowCore ( Window owner, string messageText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, System.Windows.Style messageBoxStyle ) : MessageBoxResult
owner System.Windows.Window
messageText string The message text.
caption string The caption.
button MessageBoxButton The button.
icon MessageBoxImage The icon.
defaultResult MessageBoxResult The default result.
messageBoxStyle System.Windows.Style
return MessageBoxResult
    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;
    }