From d9d8ca61ee95dff152b05fd9d5bcae8aac0fa3da Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Fri, 28 Feb 2020 22:16:52 +0200 Subject: FSE: Fixed issue with "connetin to" dialog, sn. Implemented snackbar better close behavior. --- .../FSE/Tango.FSE.Common/Notifications/SnackbarItem.cs | 15 +++++++++------ .../FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs | 5 +++-- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'Software/Visual_Studio') 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 652d3067b..832b69d92 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/SnackbarItem.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Notifications/SnackbarItem.cs @@ -36,7 +36,6 @@ namespace Tango.FSE.Common.Notifications private set { _isClosing = value; RaisePropertyChangedAuto(); } } - public SnackbarItem(MessageType type, String title, bool canClose, String message = null, TimeSpan? timeout = null, Action closeAction = null, Action pressAction = null) { Type = type; @@ -45,14 +44,18 @@ namespace Tango.FSE.Common.Notifications Message = message; Timeout = timeout; - if (pressAction != null) + _pressAction = () => { - _pressAction = () => + if (pressAction != null) { Close(); - pressAction?.Invoke(); - }; - } + pressAction.Invoke(); + } + else if (CanClose) + { + Close(); + } + }; if (canClose) { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs index dd387dfd4..10ba9d957 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs @@ -173,9 +173,10 @@ namespace Tango.FSE.UI.Connection IsBusy = true; - using (var task = NotificationProvider.PushTaskItem($"Connecting to machine '{machine.SerialNumber}'...")) + String serial = vm.GetMachineSerialNumber(); + + using (var task = NotificationProvider.PushTaskItem($"Connecting to machine '{serial}'...")) { - String serial = vm.GetMachineSerialNumber(); Machine = await Services.MachinesService.GetMachine(serial); if (Machine == null) -- cgit v1.3.1