MessageBox
Description
This component represents a modal message box in Blazor using the Gap.Blazor.MessageBox
model. It uses the Telerik Dialog
component to display messages with configurable icons, text, and button layouts. The component supports various standard button configurations such as OK, OK/Cancel, Yes/No, and Yes/No/Cancel.
Usage
Properties
messageBox: Instance of the
Gap.Blazor.MessageBox
model.LabelMessage.Text: The main message content displayed in the dialog.
Buttons: Enum (
MessageBoxButtons
) that determines which buttons are shown.Icon: Enum (
MessageBoxIcon
) that determines which icon is displayed.
Methods
GetIcon(): Returns the appropriate icon image based on the
MessageBoxIcon
value:Information
→ info iconWarning
→ warning iconError
→ error iconQuestion
→ question iconDefault → info icon
Dynamic Rendering
TelerikDialog: Renders the modal dialog.
DialogContent: Displays the icon and message text.
DialogButtons: Dynamically renders buttons based on the
Buttons
enum.WMButtonComponent: Used to render each button, bound to the corresponding model.
Button Layouts
OK
OK
OKCancel
OK, Cancel
YesNo
Yes, No
YesNoCancel
Yes, No, Cancel
Last updated