Browse Source

Switch to primary ctor

pull/438/head
Ionite 10 months ago
parent
commit
05a4c999bd
No known key found for this signature in database
  1. 13
      StabilityMatrix.Avalonia/Services/NotificationService.cs

13
StabilityMatrix.Avalonia/Services/NotificationService.cs

@ -20,23 +20,16 @@ using INotificationManager = DesktopNotifications.INotificationManager;
namespace StabilityMatrix.Avalonia.Services;
[Singleton(typeof(INotificationService))]
public class NotificationService : INotificationService, IDisposable
public class NotificationService(ILogger<NotificationService> logger, ISettingsManager settingsManager)
: INotificationService,
IDisposable
{
private readonly ILogger<NotificationService> logger;
private readonly ISettingsManager settingsManager;
private WindowNotificationManager? notificationManager;
private readonly AsyncLock nativeNotificationManagerLock = new();
private volatile INotificationManager? nativeNotificationManager;
private volatile bool isNativeNotificationManagerInitialized;
public NotificationService(ILogger<NotificationService> logger, ISettingsManager settingsManager)
{
this.logger = logger;
this.settingsManager = settingsManager;
}
public void Initialize(
Visual? visual,
NotificationPosition position = NotificationPosition.BottomRight,

Loading…
Cancel
Save