diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor index 8edd037e15..a1a60b2c9c 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs index 7413b59009..0b527d6de2 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using Blazorise; using Blazorise.Snackbar; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Localization; @@ -47,7 +48,7 @@ namespace Volo.Abp.BlazoriseUI.Components UiNotificationService.NotificationReceived += OnNotificationReceived; } - protected virtual void OnNotificationReceived(object sender, UiNotificationEventArgs e) + protected virtual async void OnNotificationReceived(object sender, UiNotificationEventArgs e) { NotificationType = e.NotificationType; Message = e.Message; @@ -56,7 +57,11 @@ namespace Volo.Abp.BlazoriseUI.Components 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()