Blazorise Message Service API

Review the provider component and service methods used to display messages, confirmations, and choices.

For setup instructions and examples, see the Message Service documentation.

API

Parameters

Parameter Description TypeDefault
BackgroundCancel

By default, a modal is cancelled if the user clicks anywhere outside the modal. This behavior can be disabled by setting BackgroundCancel to false.

booltrue
Callback

Occurs after the user respond with an action button.

TaskCompletionSource<object>null
CloseOnEscape

If true, the message dialog will be closed when the user presses the Escape key. Confirmation dialogs will treat Escape as a cancel action.

boolfalse
Message

Specifies the message content.

MarkupStringnull
MessageType

Specifies the message type.

Possible values:Info, Success, Warning, Error, Confirmation, Choice

MessageTypeMessageType.Info
Options

Specifies the custom message options.

MessageOptionsnull
Title

Specifies the message title.

string

Events

Event Description Type
Canceled

Occurs after the user has responded with a Cancel action.

EventCallback
Confirmed

Occurs after the user has responded with a Confirm action.

EventCallback
Okayed

Occurs after the user has responded with an OK action.

EventCallback

IMessageService

Events

Event Description Type
MessageReceived Raised when a message request is received by the provider. EventHandler<MessageEventArgs>

Methods

Method DescriptionReturnParameters
Info Shows an informational message. String and MarkupString overloads are available. Taskmessage, title = null, options = null
Success Shows a success message. String and MarkupString overloads are available. Taskmessage, title = null, options = null
Warning Shows a warning message. String and MarkupString overloads are available. Taskmessage, title = null, options = null
Error Shows an error message. String and MarkupString overloads are available. Taskmessage, title = null, options = null
Confirm Shows a confirmation dialog and returns the user's decision. Task<bool>message, title = null, options = null
Choose Shows a choice dialog and returns the selected value. Task<object>message, title = null, options = null
On this page