Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EventModel.cs
1using CommunityToolkit.Mvvm.ComponentModel;
2using CommunityToolkit.Mvvm.Input;
3using Microsoft.Maui.Controls.Shapes;
6
8{
16 public partial class EventModel(DateTime Received, Geometry Icon, string Description, NotificationEvent Event) : ObservableObject, IUniqueItem
17 {
21 public DateTime Received { get; } = Received;
22
26 public Geometry Icon { get; } = Icon;
27
31 public string Description { get; } = Description;
32
36 public NotificationEvent Event { get; } = Event;
37
39 public string UniqueName => this.Event.ObjectId ?? string.Empty;
40
44 [RelayCommand]
45 public void Clicked()
46 {
47 MainThread.BeginInvokeOnMainThread(async () =>
48 {
49 try
50 {
51 await this.Event.Open();
52
53 if (this.Event.DeleteWhenOpened)
55 }
56 catch (Exception ex)
57 {
58 ServiceRef.LogService.LogException(ex);
59 }
60 });
61 }
62 }
63}
Base class that references services in the app.
Definition: ServiceRef.cs:31
static ILogService LogService
Log service.
Definition: ServiceRef.cs:91
static INotificationService NotificationService
Service for managing notifications for the user.
Definition: ServiceRef.cs:211
Task DeleteEvents(NotificationEventType Type, CaseInsensitiveString Category)
Deletes events for a given button and category.
abstract class NotificationEvent()
Abstract base class of notification events.