aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2020-11-26 05:39:12 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2020-11-26 05:39:12 +0200
commitf491de7fe88e18c3df8b7d29372a31cab3893bd0 (patch)
tree44780787b21ca04556bdcbf4156e6e1afd778409 /Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels
parent01fb003c742e7f7ac086e9340254e8d0bd606214 (diff)
downloadTango-f491de7fe88e18c3df8b7d29372a31cab3893bd0.tar.gz
Tango-f491de7fe88e18c3df8b7d29372a31cab3893bd0.zip
Prevent back navigation when settings require restart.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
index ef1126261..20cfd6bf4 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
@@ -250,6 +250,8 @@ namespace Tango.PPC.MachineSettings.ViewModels
await MachineProvider.SaveMachine();
+ bool isRestarting = false;
+
if (_previousTimeZone.ToStringSafe() != SelectedTimeZone.ToStringSafe())
{
if (await NotificationProvider.ShowQuestion("Changing the time zone requires the application to restart. Do you wish to restart the application?"))
@@ -260,6 +262,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
NotificationProvider.SetGlobalBusyMessage("Setting new time zone...");
await OperationSystemManager.ChangeTimeZone(SelectedTimeZone);
NotificationProvider.ReleaseGlobalBusyMessage();
+ isRestarting = true;
ApplicationManager.Restart();
}
catch (Exception ex)
@@ -298,7 +301,10 @@ namespace Tango.PPC.MachineSettings.ViewModels
}
}
- await NavigationManager.NavigateBack();
+ if (!isRestarting)
+ {
+ await NavigationManager.NavigateBack();
+ }
}
}