44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using Radzen;
|
|
using Web.Tra.Components.Dialog;
|
|
|
|
namespace Web.Tra.Services
|
|
{
|
|
public class PopupService
|
|
{
|
|
public DialogService _dialogService;
|
|
|
|
public PopupService(DialogService dialogService)
|
|
{
|
|
_dialogService = dialogService;
|
|
}
|
|
|
|
public async Task<bool> Confirm(string title, string message)
|
|
{
|
|
bool result = false;
|
|
result = await _dialogService.Confirm(message, title, new ConfirmOptions
|
|
{
|
|
OkButtonText = "OK",
|
|
CancelButtonText = "Cancel",
|
|
}) ?? false;
|
|
return result;
|
|
}
|
|
|
|
public void OpenIndicator(string message = "")
|
|
{
|
|
_dialogService.Open<Loading>("",
|
|
new Dictionary<string, object>() { { "Message", message } },
|
|
new DialogOptions
|
|
{
|
|
ShowClose = false,
|
|
ShowTitle = false,
|
|
Style = "box-shadow: none; background: transparent; min-width:0; min-height:0; width:auto;"
|
|
});
|
|
}
|
|
|
|
public void CloseIndicator()
|
|
{
|
|
_dialogService.Close();
|
|
}
|
|
}
|
|
}
|