Browse Source

Fixed breaking change on SnackbarStack

pull/6330/head
Mladen Macanovic 6 years ago
parent
commit
747107e43d
  1. 2
      framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor
  2. 9
      framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs

2
framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor

@ -1 +1 @@
<SnackbarStack @ref="SnackbarStack" Location="SnackbarStackLocation.Right" Multiline="true" Closed="@OnSnackbarClosed" />
<SnackbarStack @ref="SnackbarStack" Location="SnackbarStackLocation.Right" Multiline="true" DelayCloseOnClick="true" DelayCloseOnClickInterval="10000" Closed="@OnSnackbarClosed" />

9
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()

Loading…
Cancel
Save