diff options
| -rw-r--r-- | Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/SnackbarItem.cs | 17 | ||||
| -rw-r--r-- | Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml | 5 |
2 files changed, 17 insertions, 5 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/SnackbarItem.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/SnackbarItem.cs index 06f28f89c..652d3067b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/SnackbarItem.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/SnackbarItem.cs @@ -13,6 +13,7 @@ namespace Tango.FSE.Common.Notifications { private Action _closeAction; private Action _pressAction; + private bool _isClosed; public MessageType Type { get; set; } @@ -69,19 +70,25 @@ namespace Tango.FSE.Common.Notifications { Task.Delay(Timeout.Value).ContinueWith((x) => { - Close(); + if (!_isClosed) + { + IsClosing = true; + Task.Delay(TimeSpan.FromSeconds(2)).ContinueWith((y) => + { + Close(); + }, TaskScheduler.FromCurrentSynchronizationContext()); + } }, TaskScheduler.FromCurrentSynchronizationContext()); } } public void Close() { - IsClosing = true; - - Task.Delay(TimeSpan.FromSeconds(2)).ContinueWith((x) => + if (!_isClosed) { + _isClosed = true; TangoIOC.Default.GetInstance<INotificationProvider>().PopSnackbarItem(this); - }, TaskScheduler.FromCurrentSynchronizationContext()); + } } } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml index 90985c969..26d6a7843 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml @@ -49,6 +49,11 @@ <ItemsControl.ItemTemplate> <DataTemplate> <Border Margin="0 5" Height="60"> + <i:Interaction.Triggers> + <i:EventTrigger EventName="MouseDown"> + <i:InvokeCommandAction Command="{Binding PressCommand}" /> + </i:EventTrigger> + </i:Interaction.Triggers> <Border.Effect> <DropShadowEffect Opacity="0.2" /> </Border.Effect> |
