diff options
| author | Roy Ben Shabat <Roy@twine-s.com> | 2020-12-30 15:11:34 +0000 |
|---|---|---|
| committer | Roy Ben Shabat <Roy@twine-s.com> | 2020-12-30 15:11:34 +0000 |
| commit | d33c19b3ac6803de4b5c8d475832efef131c1a45 (patch) | |
| tree | ea725abc39def99a755b041c13cba1fe0d594ddc /Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels | |
| parent | 1bdcaa9f51303bbff682507f31fb3b4414692ca4 (diff) | |
| download | Tango-d33c19b3ac6803de4b5c8d475832efef131c1a45.tar.gz Tango-d33c19b3ac6803de4b5c8d475832efef131c1a45.zip | |
Revert "Hope it is fine"
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 | 32 |
1 files changed, 28 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 d2a730cd7..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>(); }; @@ -144,15 +160,23 @@ namespace Tango.PPC.Events.ViewModels { case EventTypeCategories.Info: notificationItem.MessageType = MessageNotificationItem.MessageNotificationItemTypes.Info; + notificationItem.Priority = NotificationItem.NotificationPriority.Normal; break; case EventTypeCategories.Warning: notificationItem.MessageType = MessageNotificationItem.MessageNotificationItemTypes.Warning; + notificationItem.Priority = NotificationItem.NotificationPriority.High; break; case EventTypeCategories.Error: notificationItem.MessageType = MessageNotificationItem.MessageNotificationItemTypes.Error; + notificationItem.Priority = NotificationItem.NotificationPriority.VeryHigh; break; case EventTypeCategories.Critical: 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; } @@ -171,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); |
