From 05a4c999bd33d0da33c4af49a0e265817bedf987 Mon Sep 17 00:00:00 2001 From: Ionite Date: Wed, 24 Jan 2024 18:41:59 -0500 Subject: [PATCH] Switch to primary ctor --- .../Services/NotificationService.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/StabilityMatrix.Avalonia/Services/NotificationService.cs b/StabilityMatrix.Avalonia/Services/NotificationService.cs index 13722011..5e640b05 100644 --- a/StabilityMatrix.Avalonia/Services/NotificationService.cs +++ b/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 logger, ISettingsManager settingsManager) + : INotificationService, + IDisposable { - private readonly ILogger logger; - private readonly ISettingsManager settingsManager; - private WindowNotificationManager? notificationManager; private readonly AsyncLock nativeNotificationManagerLock = new(); private volatile INotificationManager? nativeNotificationManager; private volatile bool isNativeNotificationManagerInitialized; - public NotificationService(ILogger logger, ISettingsManager settingsManager) - { - this.logger = logger; - this.settingsManager = settingsManager; - } - public void Initialize( Visual? visual, NotificationPosition position = NotificationPosition.BottomRight,