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 | Default | Type |
|---|---|---|
BackgroundCancel | true | bool |
By default, a modal is cancelled if the user clicks anywhere outside the modal. This behavior can be disabled by setting BackgroundCancel to false. | ||
Callback | null | TaskCompletionSource<object> |
Occurs after the user respond with an action button. | ||
CloseOnEscape | false | bool |
If true, the message dialog will be closed when the user presses the Escape key. Confirmation dialogs will treat Escape as a cancel action. | ||
Message | null | MarkupString |
Specifies the message content. | ||
MessageType | MessageType.Info | MessageType |
Specifies the message type. Possible values: InfoSuccessWarningErrorConfirmationChoice | ||
Options | null | MessageOptions |
Specifies the custom message options. | ||
Title | — | string |
Specifies the message title. | ||
Events
| Event | Type |
|---|---|
Canceled | EventCallback |
Occurs after the user has responded with a Cancel action. | |
Confirmed | EventCallback |
Occurs after the user has responded with a Confirm action. | |
Okayed | EventCallback |
Occurs after the user has responded with an OK action. | |
IMessageService
Events
| Event | Type |
|---|---|
MessageReceived | EventHandler<MessageEventArgs> |
Raised when a message request is received by the provider.
| |
Methods
| Method | Return | Parameters |
|---|---|---|
Info | Task | message, title = null, options = null |
Shows an informational message. String and MarkupString overloads are available.
| ||
Success | Task | message, title = null, options = null |
Shows a success message. String and MarkupString overloads are available.
| ||
Warning | Task | message, title = null, options = null |
Shows a warning message. String and MarkupString overloads are available.
| ||
Error | Task | message, title = null, options = null |
Shows an error message. String and MarkupString overloads are available.
| ||
Confirm | Task<bool> | message, title = null, options = null |
Shows a confirmation dialog and returns the user's decision.
| ||
Choose | Task<object> | message, title = null, options = null |
Shows a choice dialog and returns the selected value.
| ||