...
This commit is contained in:
@@ -78,7 +78,30 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Modal @ref="_modal"
|
||||
title="Modal title"
|
||||
OnShowing="OnModalShowing"
|
||||
OnShown="OnModalShown"
|
||||
OnHiding="OnModalHiding"
|
||||
OnHidden="OnModalHidden"
|
||||
OnHidePrevented="OnModalHidePrevented">
|
||||
|
||||
<BodyTemplate>
|
||||
Modal body text goes here.
|
||||
</BodyTemplate>
|
||||
|
||||
<FooterTemplate>
|
||||
<Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
|
||||
<Button Color="ButtonColor.Primary">Save changes</Button>
|
||||
</FooterTemplate>
|
||||
|
||||
</Modal>
|
||||
|
||||
@code {
|
||||
|
||||
private Modal _modal = default!;
|
||||
[Inject] ToastService ToastService { get; set; } = default!;
|
||||
//-------------------------------
|
||||
string type = "NewTicketNoAuthentication";
|
||||
private EditContext? editContext;
|
||||
[SupplyParameterFromForm]
|
||||
@@ -105,7 +128,8 @@
|
||||
{
|
||||
messageStore?.Clear();
|
||||
var res = await request.Content.ReadFromJsonAsync<int>();
|
||||
nav.NavigateTo($"Verification/{res}");
|
||||
OnShowModalClick();
|
||||
// nav.NavigateTo($"Verification/{res}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -114,4 +138,38 @@
|
||||
|
||||
}
|
||||
}
|
||||
private async Task OnShowModalClick()
|
||||
{
|
||||
await _modal.ShowAsync();
|
||||
}
|
||||
|
||||
private async Task OnHideModalClick()
|
||||
{
|
||||
await _modal.HideAsync();
|
||||
}
|
||||
|
||||
private void OnModalShowing()
|
||||
{
|
||||
ToastService.Notify(new(ToastType.Primary, $"Event: Showing called. DateTime: {DateTime.Now}"));
|
||||
}
|
||||
|
||||
private void OnModalShown()
|
||||
{
|
||||
ToastService.Notify(new(ToastType.Success, $"Event: Show called. DateTime: {DateTime.Now}"));
|
||||
}
|
||||
|
||||
private void OnModalHiding()
|
||||
{
|
||||
ToastService.Notify(new(ToastType.Danger, $"Event: Hiding called. DateTime: {DateTime.Now}"));
|
||||
}
|
||||
|
||||
private void OnModalHidden()
|
||||
{
|
||||
ToastService.Notify(new(ToastType.Warning, $"Event: Hide called. DateTime: {DateTime.Now}"));
|
||||
}
|
||||
|
||||
private void OnModalHidePrevented()
|
||||
{
|
||||
ToastService.Notify(new(ToastType.Info, $"Event: Hide Prevented called. DateTime: {DateTime.Now}"));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user