|
|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Blazorise.Snackbar;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using Microsoft.Extensions.Localization;
|
|
|
|
|
using Volo.Abp.AspNetCore.Components.WebAssembly;
|
|
|
|
|
|
|
|
|
|
namespace Volo.Abp.BlazoriseUI.Components
|
|
|
|
|
@ -24,6 +25,8 @@ namespace Volo.Abp.BlazoriseUI.Components
|
|
|
|
|
|
|
|
|
|
[Inject] protected BlazoriseUiNotificationService UiNotificationService { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject] protected IStringLocalizerFactory StringLocalizerFactory { get; set; }
|
|
|
|
|
|
|
|
|
|
protected virtual SnackbarColor GetSnackbarColor(UiNotificationType notificationType)
|
|
|
|
|
{
|
|
|
|
|
return notificationType switch
|
|
|
|
|
@ -50,7 +53,9 @@ namespace Volo.Abp.BlazoriseUI.Components
|
|
|
|
|
Title = e.Title;
|
|
|
|
|
Options = e.Options;
|
|
|
|
|
|
|
|
|
|
SnackbarStack.Push(Message, GetSnackbarColor(e.NotificationType));
|
|
|
|
|
var okButtonText = Options?.OkButtonText?.Localize(StringLocalizerFactory);
|
|
|
|
|
|
|
|
|
|
SnackbarStack.Push(Message, GetSnackbarColor( e.NotificationType ), okButtonText);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void Dispose()
|
|
|
|
|
|