aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-02-23 14:50:11 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-02-23 14:50:11 +0200
commit84c6b6dc548751769db3d489effe2f5f5df2d08d (patch)
treee9b39af316b39a74afeaa3f63afc8328e6cc4126 /Software
parent01b164d5a5c1e73e36855c13bdc69153b9c39b5c (diff)
downloadTango-84c6b6dc548751769db3d489effe2f5f5df2d08d.tar.gz
Tango-84c6b6dc548751769db3d489effe2f5f5df2d08d.zip
Snapback improvements.
Diffstat (limited to 'Software')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/SnackbarItem.cs17
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/Views/MainView.xaml5
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>