Seenginx/Seenginx/Components/GeneralNotificationModal.ra...

30 lines
974 B
C#
Raw Normal View History

2020-05-03 02:10:32 +02:00
using Blazorise;
using Microsoft.AspNetCore.Components;
2020-07-02 09:15:33 +02:00
using Seenginx.Models;
2020-05-03 02:10:32 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Seenginx.Components
{
public class GeneralNotificationModalBase : ComponentBase
{
2020-07-02 09:15:33 +02:00
public Modal ModalReference { get; set; } = new Modal();
public NotificationSettings NotificationSettings { get; set; }
2020-05-03 02:10:32 +02:00
[Parameter]
2020-07-02 09:15:33 +02:00
public EventCallback<PopupAnswer> PopupCallback { get; set; }
2020-05-03 02:10:32 +02:00
2020-07-02 09:15:33 +02:00
public void Show(NotificationSettings notificationSettings)
2020-05-03 02:10:32 +02:00
{
2020-07-02 09:15:33 +02:00
NotificationSettings = notificationSettings;
2020-05-03 02:10:32 +02:00
ModalReference.Show();
}
2020-07-02 09:15:33 +02:00
public async Task Ok() => await PopupCallback.InvokeAsync(PopupAnswer.Ok);
public async Task Cancel() => await PopupCallback.InvokeAsync(PopupAnswer.Cancel);
public async Task Yes() => await PopupCallback.InvokeAsync(PopupAnswer.Yes);
public async Task No() => await PopupCallback.InvokeAsync(PopupAnswer.No);
2020-05-03 02:10:32 +02:00
}
}