aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2018-04-21 19:49:05 +0300
committerRoy <roy.mail.net@gmail.com>2018-04-21 19:49:05 +0300
commit0dec8a74239cff769836cae577fbd84824070e83 (patch)
treed6cc24ee53454b3f17f1580e90de38238555b6bd /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
parent4df1724226c0d0941b970dbe71b1476e3c3e9902 (diff)
downloadTango-0dec8a74239cff769836cae577fbd84824070e83.tar.gz
Tango-0dec8a74239cff769836cae577fbd84824070e83.zip
Implemented NavigationControl for better performance!!!
Redesign of machine studio module initialization.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs21
1 files changed, 15 insertions, 6 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
index 7fefe4a41..fafa752c5 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
@@ -41,6 +41,15 @@ namespace Tango.MachineStudio.UI.ViewModels
set { _email = value; RaisePropertyChangedAuto(); }
}
+ private String _password;
+ [Required(ErrorMessage = "Password is required")]
+ public String Password
+ {
+ get { return _password; }
+ set { _password = value; RaisePropertyChangedAuto(); }
+ }
+
+
private bool _rememberMe;
/// <summary>
/// Gets or sets a value indicating whether to remember the last user email and password.
@@ -54,7 +63,7 @@ namespace Tango.MachineStudio.UI.ViewModels
/// <summary>
/// Gets or sets the login command.
/// </summary>
- public RelayCommand<String> LoginCommand { get; set; }
+ public RelayCommand LoginCommand { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="LoginViewVM"/> class.
@@ -68,29 +77,29 @@ namespace Tango.MachineStudio.UI.ViewModels
_navigationManager = navigationManager;
_authenticationProvider = authenticationProvider;
_eventLogger = eventLogger;
- LoginCommand = new RelayCommand<String>(Login);
+ LoginCommand = new RelayCommand(Login);
cryptographer = new Rfc2898Cryptographer();
Email = SettingsManager.Default.MachineStudio.LastLoginEmail;
RememberMe = SettingsManager.Default.MachineStudio.RememberMe;
+ Password = cryptographer.Decrypt(SettingsManager.Default.MachineStudio.LastLoginPassword);
}
/// <summary>
/// Logins the requested user.
/// </summary>
- /// <param name="password">The password.</param>
- private void Login(String password)
+ private void Login()
{
if (Validate())
{
try
{
- _authenticationProvider.Login(Email, password);
+ _authenticationProvider.Login(Email, Password);
_navigationManager.NavigateTo(NavigationView.MainView);
SettingsManager.Default.MachineStudio.LastLoginEmail = Email;
SettingsManager.Default.MachineStudio.RememberMe = RememberMe;
- SettingsManager.Default.MachineStudio.LastLoginPassword = RememberMe ? cryptographer.Encrypt(password) : null;
+ SettingsManager.Default.MachineStudio.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null;
SettingsManager.SaveDefaultSettings();
_eventLogger.Log("User logged in");