-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathModalDialog.razor
More file actions
45 lines (39 loc) · 1.17 KB
/
Copy pathModalDialog.razor
File metadata and controls
45 lines (39 loc) · 1.17 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
43
44
45
<div class="modal @modalClass overflow-auto" tabindex="-1" role="dialog" style="display:@modalDisplay;">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">@Title</h5>
<button type="button" class="btn-close" data-dismiss="modal" aria-label="Close" @onclick="Close">
</button>
</div>
<div class="modal-body">
@ChildContent
</div>
</div>
</div>
</div>
@if (showBackdrop)
{
<div class="modal-backdrop fade show"></div>
}
@code {
[Parameter, EditorRequired]
public required string Title { get; set; }
[Parameter, EditorRequired]
public required RenderFragment ChildContent { get; set; }
private string modalDisplay = "none;";
private string modalClass = "";
private bool showBackdrop = false;
public void Open()
{
modalDisplay = "block";
modalClass = "show";
showBackdrop = true;
}
public void Close()
{
modalDisplay = "none";
modalClass = "";
showBackdrop = false;
}
}