diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-08 17:55:46 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-08 17:55:46 +0300 |
| commit | 36d1edb4f9cc4fbd9c134d3b387bcfec05424537 (patch) | |
| tree | 4f780184ad9d41c0ab84637116c06bcff4c1cb67 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs | |
| parent | a2cf6c8d62083a63ee193a1cd206ab345368b242 (diff) | |
| download | Tango-36d1edb4f9cc4fbd9c134d3b387bcfec05424537.tar.gz Tango-36d1edb4f9cc4fbd9c134d3b387bcfec05424537.zip | |
Doing some work on PPC + Mirta integration.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs | 17 |
1 files changed, 17 insertions, 0 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 293435d0b..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,10 +61,14 @@ 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."); } @@ -60,6 +76,7 @@ namespace Tango.PPC.UI.ViewModels { await Task.Delay(500); await NavigationManager.NavigateTo(NavigationView.HomeModule); + IsLoading = false; }; } } |
