-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblazor-modal-dialog.razor
More file actions
42 lines (35 loc) · 1.05 KB
/
blazor-modal-dialog.razor
File metadata and controls
42 lines (35 loc) · 1.05 KB
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
37
38
39
40
41
42
<div class="modal" tabindex="-1" style="display:block;background-color:gainsboro" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">@Text</h3>
</div>
<div class="modal-body">
<button class="btn btn-danger"@onclick="DoYes">
@Choice1
</button>
<button class="btn btn-primary" @onclick="DoNothing">
@Choice2
</button>
</div>
</div>
</div>
</div>
@code {
[Parameter]
public string Choice1 { get; set; }
[Parameter]
public string Choice2 { get; set; }
[Parameter]
public string Text { get; set; }
[Parameter]
public EventCallback<int> ConfirmResult { get; set; }
private async Task DoYes(MouseEventArgs obj)
{
await ConfirmResult.InvokeAsync(1);
}
private async Task DoNothing(MouseEventArgs obj)
{
await ConfirmResult.InvokeAsync(2);
}
}