diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-07-09 13:32:33 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-07-09 13:32:33 +0300 |
| commit | 6b755271ed4ef5f1b1d09d96e54fe081920f4f41 (patch) | |
| tree | 51f6bb96aefb3666c827d1dd06ef6d76cf81a44a /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels | |
| parent | 042a453f826da5c8a600ab4ae8b3d611044168de (diff) | |
| parent | 47396728e782e433a11768904cda94c47dc02933 (diff) | |
| download | Tango-6b755271ed4ef5f1b1d09d96e54fe081920f4f41.tar.gz Tango-6b755271ed4ef5f1b1d09d96e54fe081920f4f41.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs | 22 |
1 files changed, 20 insertions, 2 deletions
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 6107a906d..dd54873ce 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs @@ -8,6 +8,7 @@ using Tango.PPC.Common; using Tango.PPC.Common.Navigation; using SimpleValidator.Extensions; using System.ComponentModel.DataAnnotations; +using Tango.SharedUI.Helpers; namespace Tango.PPC.UI.ViewModels { @@ -32,6 +33,17 @@ namespace Tango.PPC.UI.ViewModels set { _password = value; RaisePropertyChangedAuto(); } } + private bool _isLoading; + /// <summary> + /// Gets or sets a value indicating whether the application is busy with loading modules. + /// </summary> + public bool IsLoading + { + get { return _isLoading; } + set { _isLoading = value; RaisePropertyChangedAuto(); } + } + + public LoginViewVM() { LoginCommand = new RelayCommand(Login); @@ -49,16 +61,22 @@ namespace Tango.PPC.UI.ViewModels { if (Validate()) { + IsLoading = true; + UIHelper.DoEvents(); + var user = AuthenticationProvider.Login(Email, Password); if (user == null) { + IsLoading = false; NotificationProvider.ShowWarning("Email or password are incorrect."); } - ApplicationManager.ModulesInitialized += (_, __) => + ApplicationManager.ModulesInitialized += async (_, __) => { - NavigationManager.NavigateTo(NavigationView.HomeModule); + await Task.Delay(500); + await NavigationManager.NavigateTo(NavigationView.HomeModule); + IsLoading = false; }; } } |
