In This Article

ThemedMessageBox Class

Displays a message box.

public static class ThemedMessageBox
Inheritance:
object object

Methods

RegisterGlobalBuilderConfigureCallback(Action<UserPromptBuilder>?)

Registers a global delegate to be called to configure a new instance of a UserPromptBuilder created specifically for message box prompts.

public static void RegisterGlobalBuilderConfigureCallback(Action<UserPromptBuilder>? callback)
Parameter Type Description
callback Action<UserPromptBuilder>

The callback, which will be invoked immediately after the instance is created and before any instance-specific configuration can be applied.

Show(string)

Displays a message box that has a message and that returns a result.

public static MessageBoxResult Show(string messageBoxText)
Parameter Type Description
messageBoxText string

A string that specifies the text to display.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(string, string)

Displays a message box that has a message and title bar caption; and that returns a result.

public static MessageBoxResult Show(string messageBoxText, string caption)
Parameter Type Description
messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(string, string, MessageBoxButton)

Displays a message box that has a message, title bar caption, and button; and that returns a result.

public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button)
Parameter Type Description
messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(string, string, MessageBoxButton, MessageBoxImage)

Displays a message box that has a message, title bar caption, button, and icon; and that returns a result.

public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon)
Parameter Type Description
messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

icon MessageBoxImage

A MessageBoxImage value that specifies the icon to display.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult)

Displays a message box that has a message, title bar caption, button, and icon; and that accepts a default message box result and returns a result.

public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult)
Parameter Type Description
messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

icon MessageBoxImage

A MessageBoxImage value that specifies the icon to display.

defaultResult MessageBoxResult

A MessageBoxResult value that specifies the default result of the message box.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult, Action)

Displays a message box that has a message, title bar caption, button, and icon; and that accepts a default message box result, a help action, and returns a result.

[Obsolete("Use the overload that accepts 'Action<UserPromptBuilder>' for configuring help command.  This method will be removed in a future release.")]
public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, Action helpAction)
Parameter Type Description
messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

icon MessageBoxImage

A MessageBoxImage value that specifies the icon to display.

defaultResult MessageBoxResult

A MessageBoxResult value that specifies the default result of the message box.

helpAction Action

When specified, adds a 'Help' button whose command will invoke the specified Action.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult, Action<UserPromptBuilder>)

Displays a message box that has a message, title bar caption, button, and icon; and that accepts a default message box result, a help action, and returns a result.

public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, Action<UserPromptBuilder> configure)
Parameter Type Description
messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

icon MessageBoxImage

A MessageBoxImage value that specifies the icon to display.

defaultResult MessageBoxResult

A MessageBoxResult value that specifies the default result of the message box.

configure Action<UserPromptBuilder>

A action which will be called to further configure the UserPromptBuilder initialized for the message box, including options to define a Help command.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(Window, string)

Displays a message box in front of the specified window. The message box displays a message and returns a result.

public static MessageBoxResult Show(Window owner, string messageBoxText)
Parameter Type Description
owner Window

A Window that represents the owner window of the message box.

messageBoxText string

A string that specifies the text to display.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(Window, string, string)

Displays a message box in front of the specified window. The message box displays a message and title bar caption; and it returns a result.

public static MessageBoxResult Show(Window owner, string messageBoxText, string caption)
Parameter Type Description
owner Window

A Window that represents the owner window of the message box.

messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(Window, string, string, MessageBoxButton)

Displays a message box in front of the specified window. The message box displays a message, title bar caption, and button; and it also returns a result.

public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button)
Parameter Type Description
owner Window

A Window that represents the owner window of the message box.

messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(Window, string, string, MessageBoxButton, MessageBoxImage)

Displays a message box in front of the specified window. The message box displays a message, title bar caption, button, and icon; and it also returns a result.

public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon)
Parameter Type Description
owner Window

A Window that represents the owner window of the message box.

messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

icon MessageBoxImage

A MessageBoxImage value that specifies the icon to display.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(Window, string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult)

Displays a message box in front of the specified window. The message box displays a message, title bar caption, button, and icon; and accepts a default message box result and returns a result.

public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult)
Parameter Type Description
owner Window

A Window that represents the owner window of the message box.

messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

icon MessageBoxImage

A MessageBoxImage value that specifies the icon to display.

defaultResult MessageBoxResult

A MessageBoxResult value that specifies the default result of the message box.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(Window, string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult, Action)

Displays a message box in front of the specified window. The message box displays a message, title bar caption, button, and icon; and that accepts a default message box result, a help action, and returns a result.

[Obsolete("Use the overload that accepts 'Action<UserPromptBuilder>' for configuring help command.  This method will be removed in a future release.")]
public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, Action helpAction)
Parameter Type Description
owner Window

A Window that represents the owner window of the message box.

messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

icon MessageBoxImage

A MessageBoxImage value that specifies the icon to display.

defaultResult MessageBoxResult

A MessageBoxResult value that specifies the default result of the message box.

helpAction Action

When specified, adds a 'Help' button whose command will invoke the specified Action.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Show(Window, string, string, MessageBoxButton, MessageBoxImage, MessageBoxResult, Action<UserPromptBuilder>)

Displays a message box in front of the specified window. The message box displays a message, title bar caption, button, and icon; and that accepts a default message box result, a help action, and returns a result.

public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, Action<UserPromptBuilder> configure)
Parameter Type Description
owner Window

A Window that represents the owner window of the message box.

messageBoxText string

A string that specifies the text to display.

caption string

A string that specifies the title bar caption to display.

button MessageBoxButton

A MessageBoxButton value that specifies which button or buttons to display.

icon MessageBoxImage

A MessageBoxImage value that specifies the icon to display.

defaultResult MessageBoxResult

A MessageBoxResult value that specifies the default result of the message box.

configure Action<UserPromptBuilder>

A action which will be called to further configure the UserPromptBuilder initialized for the message box, including options to define a Help command.

Returns

MessageBoxResult:

A MessageBoxResult value that specifies which message box button is clicked by the user.

Inherited Members