1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/src/Artemis.UI.Shared/Services/NotificationService.cs

24 lines
741 B
C#

using Artemis.UI.Shared.Services.Builders;
using Avalonia.Controls;
namespace Artemis.UI.Shared.Services
{
internal class NotificationService : INotificationService
{
private readonly IWindowService _windowService;
public NotificationService(IWindowService windowService)
{
_windowService = windowService;
}
public NotificationBuilder CreateNotification()
{
Window? currentWindow = _windowService.GetCurrentWindow();
if (currentWindow == null)
throw new ArtemisSharedUIException("Can't show an in-app notification without any windows being shown.");
return new NotificationBuilder(currentWindow);
}
}
}