-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathConfirmDialog.razor
More file actions
36 lines (29 loc) · 954 Bytes
/
Copy pathConfirmDialog.razor
File metadata and controls
36 lines (29 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<ModalDialog @ref="ModalDialog" Title="@Title">
<h3>@Content</h3>
<div class="d-flex justify-content-end gap-2 mt-4">
<button id="ok" @onclick="OnYesButtonPressed" type="button" class="btn btn-primary w-100">Ok</button>
<button id="cancel" @onclick="OnNoButtonPressed" type="button" class="btn btn-secondary w-100" >Cancel</button>
</div>
</ModalDialog>
@code {
[Parameter, EditorRequired]
public required string Title { get; set; }
[Parameter, EditorRequired]
public required string Content { get; set; }
[Parameter]
public EventCallback OnYesPressed { get; set; }
private ModalDialog ModalDialog { get; set; } = default!;
private async Task OnYesButtonPressed()
{
ModalDialog.Close();
await OnYesPressed.InvokeAsync();
}
public void Open()
{
ModalDialog.Open();
}
private void OnNoButtonPressed()
{
ModalDialog.Close();
}
}