Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NotificationListItem.cs
1using CommunityToolkit.Mvvm.ComponentModel;
2using Microsoft.Maui.Graphics;
3
5{
9 public partial class NotificationListItem : ObservableObject
10 {
21 public NotificationListItem(string Id, string Title, string? Body, string? Channel, string DateText, string StateLabel, int OccurrenceCount)
22 {
23 this.Id = Id;
24 this.Title = Title;
25 this.Body = Body ?? string.Empty;
26 this.Channel = Channel ?? string.Empty;
27 this.DateText = DateText;
28 this.StateLabel = StateLabel;
29 this.OccurrenceCount = OccurrenceCount <= 0 ? 1 : OccurrenceCount;
30 this.StateColor = StateLabel switch
31 {
32 "New" => AppColors.TnPWarningBg,
33 "Read" => AppColors.TnPInfoBg,
34 "Opened" => AppColors.TnPInfoBg,
35 _ => Colors.Transparent
36 };
37 this.StateTextColor = StateLabel switch
38 {
39 "New" => AppColors.TnPWarningContent,
40 "Read" => AppColors.TnPInfoContent,
41 "Opened" => AppColors.TnPInfoContent,
42 _ => Colors.Transparent
43 };
44 }
45
49 public string Id { get; }
50
54 public string Title { get; }
55
59 public string Body { get; }
60
64 public string Channel { get; }
65
69 public string DateText { get; }
70
74 public string StateLabel { get; }
75
79 public int OccurrenceCount { get; }
80
84 public Color StateColor { get; }
85
89 public Color StateTextColor { get; }
90 }
91}
Static class that gives access to app-specific themed colors. All colors are fetched directly from th...
Definition: AppColors.cs:8
NotificationListItem(string Id, string Title, string? Body, string? Channel, string DateText, string StateLabel, int OccurrenceCount)
Initializes a new instance of the NotificationListItem class.
string Channel
Channel label used for display and icon resolution.
int OccurrenceCount
Number of occurrences merged into this record.
Definition: ImplTypes.g.cs:58