From 6511527e4b576d29fc97aa80479b61d7d1abc079 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 7 Aug 2018 19:26:57 +0300 Subject: Working on PPC Machine Setup ! --- .../PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs index 38616f39f..d5915eeb0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs @@ -27,6 +27,8 @@ namespace Tango.PPC.UI.ViewModels /// public class LoadingViewVM : PPCViewModel { + private bool _setup; + /// /// Gets or sets the module loader. /// @@ -46,9 +48,19 @@ namespace Tango.PPC.UI.ViewModels /// /// Initializes a new instance of the class. /// - public LoadingViewVM() + public LoadingViewVM(IPPCApplicationManager applicationManager) { - Task.Delay(1000).ContinueWith((x) => { IsLoading = true; }); + if (!DesignMode) + { + applicationManager.SetupRequired += ApplicationManager_SetupRequired; + Task.Delay(1000).ContinueWith((x) => { IsLoading = true; }); + } + } + + private void ApplicationManager_SetupRequired(object sender, SetupRequiredEventArgs e) + { + _setup = true; + NavigationManager.NavigateTo(NavigationView.MachineSetupView); } /// @@ -56,8 +68,12 @@ namespace Tango.PPC.UI.ViewModels /// public override void OnApplicationStarted() { - NavigationManager.NavigateTo(NavigationView.LoginView); IsLoading = false; + + if (!_setup) + { + NavigationManager.NavigateTo(NavigationView.LoginView); + } } } } -- cgit v1.3.1