28 lines
917 B
Plaintext
28 lines
917 B
Plaintext
@using MudBlazor
|
|
|
|
<MudDialog>
|
|
<TitleContent>
|
|
<MudText Typo="Typo.h6">@Title</MudText>
|
|
</TitleContent>
|
|
<DialogContent>
|
|
<MudText>@Message</MudText>
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudButton OnClick="Cancel">Cancel</MudButton>
|
|
<MudButton Variant="Variant.Filled" Color="@ConfirmColor" OnClick="Confirm">@ConfirmText</MudButton>
|
|
</DialogActions>
|
|
</MudDialog>
|
|
|
|
@code {
|
|
[CascadingParameter] IMudDialogInstance Dialog { get; set; } = null!;
|
|
[Parameter] public string Title { get; set; } = "Confirm";
|
|
[Parameter] public string Message { get; set; } = "Are you sure?";
|
|
[Parameter] public string ConfirmText { get; set; } = "Confirm";
|
|
[Parameter] public Color ConfirmColor { get; set; } = Color.Primary;
|
|
|
|
private void Cancel() => Dialog.Cancel();
|
|
|
|
private void Confirm() => Dialog.Close(DialogResult.Ok(true));
|
|
}
|
|
|