aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-10-14 09:52:56 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-10-14 09:52:56 +0300
commitf8c7406933bf6a4d92abfc0e54db90bcf719799f (patch)
treeb80cb0913c40f95b785f8c096c44f9c6779b8b69 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Events
parentc7bacadc89a1af1fa4370961e98ca3d0f89fb229 (diff)
downloadTango-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')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Resources/Styles.xaml4
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs28
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml8
3 files changed, 32 insertions, 8 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Resources/Styles.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Resources/Styles.xaml
index 53102d8ec..eaf621571 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Resources/Styles.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Resources/Styles.xaml
@@ -18,11 +18,11 @@
<Setter Property="Height" Value="68"></Setter>
<Setter Property="Margin" Value="5 0 5 5"></Setter>
<Setter Property="CornerRadius" Value="5"></Setter>
- <Setter Property="Effect">
+ <!--<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="5" ShadowDepth="1" Color="Silver" />
</Setter.Value>
- </Setter>
+ </Setter>-->
</Style>
<Style TargetType="{x:Type touch:LightTouchDataGridRow}">
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);
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml
index af42a5576..f0ae4b128 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml
@@ -143,8 +143,8 @@
<touch:TouchIcon Width="32" Height="32" IsHitTestVisible="False">
<touch:TouchIcon.Style>
<Style TargetType="touch:TouchIcon">
- <Setter Property="Icon" Value="CheckCircleOutline"/>
- <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"/>
+ <Setter Property="Icon" Value="Information"/>
+ <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Category,Mode=OneWay}" Value="Warning">
<Setter Property="Icon" Value="AlertCircleOutline"/>
@@ -158,6 +158,10 @@
<Setter Property="Icon" Value="Alert"/>
<Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"/>
</DataTrigger>
+ <DataTrigger Binding="{Binding Category,Mode=OneWay}" Value="Success">
+ <Setter Property="Icon" Value="CheckCircleOutline"/>
+ <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"/>
+ </DataTrigger>
</Style.Triggers>
</Style>
</touch:TouchIcon.Style>