aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels
diff options
context:
space:
mode:
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.cs32
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);