diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-28 16:35:16 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-28 16:35:16 +0300 |
| commit | f3fc87dd10b3d55591a84ecbfb0612769f0c09b9 (patch) | |
| tree | 640621ab876dd5368d91e44b07b4f2872752e5bb /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels | |
| parent | 37fe17f09478a486dcd51f0edd8028724dc85c16 (diff) | |
| download | Tango-f3fc87dd10b3d55591a84ecbfb0612769f0c09b9.tar.gz Tango-f3fc87dd10b3d55591a84ecbfb0612769f0c09b9.zip | |
Working on BL Builders !
Working on making PPC work with builders..
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 12 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs | 24 |
2 files changed, 13 insertions, 23 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 3bcacc989..28692cdfa 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -192,7 +192,6 @@ namespace Tango.PPC.UI.ViewModels public override void OnApplicationStarted() { base.OnApplicationStarted(); - ModuleLoader.ModulesLoaded += ModuleLoader_ModulesLoaded; MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted; } @@ -218,17 +217,6 @@ namespace Tango.PPC.UI.ViewModels _jobHandler = e.JobHandler; } - /// <summary> - /// Handles the ModulesLoaded event of the ModuleLoader. - /// </summary> - /// <param name="sender">The source of the event.</param> - /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> - private void ModuleLoader_ModulesLoaded(object sender, EventArgs e) - { - LogManager.Log("Modules loaded. Applying modules to main navigation control..."); - View.ApplyModules(ModuleLoader.UserModules); - } - #endregion } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs index 812f10121..9d17a4a76 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs @@ -84,6 +84,16 @@ namespace Tango.PPC.UI.ViewModels AuthenticationProvider.CurrentUserChanged += AuthenticationProvider_CurrentUserChanged; } + public override async void OnApplicationReady() + { + base.OnApplicationReady(); + + await Task.Delay(500); + LogManager.Log("Application is ready! Navigating to home module..."); + await NavigationManager.NavigateTo(NavigationView.HomeModule); + IsLoading = false; + } + #endregion #region Event Handlers @@ -108,7 +118,7 @@ namespace Tango.PPC.UI.ViewModels /// <summary> /// Login to the application using the user name and password. /// </summary> - private void Login() + private async void Login() { LogManager.Log("Login command pressed."); @@ -117,21 +127,13 @@ namespace Tango.PPC.UI.ViewModels IsLoading = true; UIHelper.DoEvents(); - var user = AuthenticationProvider.Login(Email, Password); + var user = await AuthenticationProvider.Login(Email, Password); if (user == null) { IsLoading = false; - NotificationProvider.ShowWarning("Email or password are incorrect."); + await NotificationProvider.ShowWarning("Email or password are incorrect."); } - - ApplicationManager.ModulesInitialized += async (_, __) => - { - await Task.Delay(500); - LogManager.Log("Modules initialized. Navigating to home module..."); - await NavigationManager.NavigateTo(NavigationView.HomeModule); - IsLoading = false; - }; } else { |
