diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-10-14 09:52:56 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-10-14 09:52:56 +0300 |
| commit | f8c7406933bf6a4d92abfc0e54db90bcf719799f (patch) | |
| tree | b80cb0913c40f95b785f8c096c44f9c6779b8b69 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels | |
| parent | c7bacadc89a1af1fa4370961e98ca3d0f89fb229 (diff) | |
| download | Tango-f8c7406933bf6a4d92abfc0e54db90bcf719799f.tar.gz Tango-f8c7406933bf6a4d92abfc0e54db90bcf719799f.zip | |
Added and integrated persistent and success events to PPC/FSE.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs index 3f549598a..a6e6b7a4e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs @@ -127,15 +127,31 @@ namespace Tango.PPC.Events.ViewModels { if (ev.NotificationTime != EventTypeNotificationTimes.None) { - CurrentEvents.Insert(0, ev); + if (!ev.EventType.Persistent) + { + CurrentEvents.Insert(0, ev); + } + else + { + HistoryEvents.Insert(0, ev); + } var notificationItem = new MessageNotificationItem(); - notificationItem.CanClose = false; + notificationItem.CanClose = ev.EventType.Persistent; notificationItem.Message = ev.EventType.Title; notificationItem.ExpandedMessage = ev.EventType.Description; notificationItem.Pressed += async (_, __) => { - SelectedEventsSource = EventsSource.CURRENT; + if (!ev.EventType.Persistent) + { + SelectedEventsSource = EventsSource.CURRENT; + } + else + { + SelectedEventsSource = EventsSource.HISTORY; + notificationItem.Dispose(); + } + SelectedEvent = ev; await NavigationManager.NavigateTo<EventsModule>(); }; @@ -158,6 +174,10 @@ namespace Tango.PPC.Events.ViewModels notificationItem.MessageType = MessageNotificationItem.MessageNotificationItemTypes.Critical; notificationItem.Priority = NotificationItem.NotificationPriority.Critical; break; + case EventTypeCategories.Success: + notificationItem.MessageType = MessageNotificationItem.MessageNotificationItemTypes.Success; + notificationItem.Priority = NotificationItem.NotificationPriority.VeryHigh; + break; } NotificationProvider.PushNotification(notificationItem); @@ -175,7 +195,7 @@ namespace Tango.PPC.Events.ViewModels { InvokeUI(() => { - if (ev.NotificationTime != EventTypeNotificationTimes.None) + if (ev.NotificationTime != EventTypeNotificationTimes.None && !ev.EventType.Persistent) { CurrentEvents.Remove(ev); HistoryEvents.Insert(0, ev); |
