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 | Type | Default |
|---|---|---|---|
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. |
bool | true |
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. |
bool | false |
Message |
Specifies the message content. |
MarkupString | null |
MessageType |
Specifies the message type. Possible values: |
MessageType | MessageType.Info |
Options |
Specifies the custom message options. |
MessageOptions | null |
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 | Description | Return | Parameters |
|---|---|---|---|
Info |
Shows an informational message. String and MarkupString overloads are available.
| Task | message, title = null, options = null |
Success |
Shows a success message. String and MarkupString overloads are available.
| Task | message, title = null, options = null |
Warning |
Shows a warning message. String and MarkupString overloads are available.
| Task | message, title = null, options = null |
Error |
Shows an error message. String and MarkupString overloads are available.
| Task | message, 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 |