Creata card notifiche
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
namespace salesbook.Shared.Core.Dto.Notification;
|
||||
|
||||
public class PushNotificationDTO
|
||||
{
|
||||
public string? Title { get; set; }
|
||||
public string? Message { get; set; }
|
||||
|
||||
public DateTime Hours => DateTime.Now;
|
||||
}
|
||||
8
salesbook.Shared/Core/Dto/PageState/NotificationState.cs
Normal file
8
salesbook.Shared/Core/Dto/PageState/NotificationState.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using salesbook.Shared.Core.Dto.Notification;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto.PageState;
|
||||
|
||||
public class NotificationState
|
||||
{
|
||||
public List<PushNotificationDTO> UnreadNotifications { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
using salesbook.Shared.Core.Dto.Notification;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Notification;
|
||||
|
||||
public class NewPushNotificationMessage(PushNotificationDTO value) : ValueChangedMessage<PushNotificationDTO>(value);
|
||||
@@ -0,0 +1,14 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using salesbook.Shared.Core.Dto.Notification;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Notification;
|
||||
|
||||
public class NewPushNotificationService
|
||||
{
|
||||
public event Action<PushNotificationDTO>? OnNotificationReceived;
|
||||
|
||||
public NewPushNotificationService(IMessenger messenger)
|
||||
{
|
||||
messenger.Register<NewPushNotificationMessage>(this, (_, o) => { OnNotificationReceived?.Invoke(o.Value); });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user