aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs22
1 files changed, 19 insertions, 3 deletions
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
/// <seealso cref="Tango.PPC.Common.PPCViewModel" />
public class LoadingViewVM : PPCViewModel
{
+ private bool _setup;
+
/// <summary>
/// Gets or sets the module loader.
/// </summary>
@@ -46,9 +48,19 @@ namespace Tango.PPC.UI.ViewModels
/// <summary>
/// Initializes a new instance of the <see cref="LoadingViewVM"/> class.
/// </summary>
- 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);
}
/// <summary>
@@ -56,8 +68,12 @@ namespace Tango.PPC.UI.ViewModels
/// </summary>
public override void OnApplicationStarted()
{
- NavigationManager.NavigateTo(NavigationView.LoginView);
IsLoading = false;
+
+ if (!_setup)
+ {
+ NavigationManager.NavigateTo(NavigationView.LoginView);
+ }
}
}
}