|
|
@ -1,5 +1,6 @@ |
|
|
using System; |
|
|
using System; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
|
|
|
using Blazorise; |
|
|
using Blazorise.Snackbar; |
|
|
using Blazorise.Snackbar; |
|
|
using Microsoft.AspNetCore.Components; |
|
|
using Microsoft.AspNetCore.Components; |
|
|
using Microsoft.Extensions.Localization; |
|
|
using Microsoft.Extensions.Localization; |
|
|
@ -47,7 +48,7 @@ namespace Volo.Abp.BlazoriseUI.Components |
|
|
UiNotificationService.NotificationReceived += OnNotificationReceived; |
|
|
UiNotificationService.NotificationReceived += OnNotificationReceived; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected virtual void OnNotificationReceived(object sender, UiNotificationEventArgs e) |
|
|
protected virtual async void OnNotificationReceived(object sender, UiNotificationEventArgs e) |
|
|
{ |
|
|
{ |
|
|
NotificationType = e.NotificationType; |
|
|
NotificationType = e.NotificationType; |
|
|
Message = e.Message; |
|
|
Message = e.Message; |
|
|
@ -56,7 +57,11 @@ namespace Volo.Abp.BlazoriseUI.Components |
|
|
|
|
|
|
|
|
var okButtonText = Options?.OkButtonText?.Localize(StringLocalizerFactory); |
|
|
var okButtonText = Options?.OkButtonText?.Localize(StringLocalizerFactory); |
|
|
|
|
|
|
|
|
SnackbarStack.Push(Message, GetSnackbarColor( e.NotificationType ), okButtonText); |
|
|
await SnackbarStack.PushAsync(Message, Title, GetSnackbarColor( e.NotificationType ), (options) => |
|
|
|
|
|
{ |
|
|
|
|
|
options.CloseButtonIcon = IconName.Times; |
|
|
|
|
|
options.ActionButtonText = okButtonText; |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual void Dispose() |
|
|
public virtual void Dispose() |
|
|
|