aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs20
1 files changed, 15 insertions, 5 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
index 1ee741d86..bbbb854b9 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -28,6 +29,7 @@ namespace Tango.FSE.UI.ViewModels
}
private String _email;
+ [EmailAddress(ErrorMessage = "Please enter a valid email address")]
public String Email
{
get { return _email; }
@@ -35,12 +37,20 @@ namespace Tango.FSE.UI.ViewModels
}
private String _password;
+ [Required(ErrorMessage = "Password is required")]
public String Password
{
get { return _password; }
set { _password = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
+ private bool _rememberMe;
+ public bool RememberMe
+ {
+ get { return _rememberMe; }
+ set { _rememberMe = value; RaisePropertyChangedAuto(); }
+ }
+
private EnvironmentConfiguration _selectedEnvironment;
public EnvironmentConfiguration SelectedEnvironment
{
@@ -83,6 +93,11 @@ namespace Tango.FSE.UI.ViewModels
{
try
{
+ if (!Validate())
+ {
+ return;
+ }
+
IsFree = false;
SelectedView = LoginViews.Logging;
var result = await AuthenticationProvider.Login(Email, Password, SelectedEnvironment);
@@ -111,11 +126,6 @@ namespace Tango.FSE.UI.ViewModels
IsFree = true;
SelectedView = LoginViews.Login;
await NotificationProvider.ShowError(ex.GetFirstIfAggregate().Message);
- //await NotificationProvider.ShowWarning(ex.Message);
- //await NotificationProvider.ShowSuccess(ex.Message);
- //await NotificationProvider.ShowInfo(ex.Message);
- //await NotificationProvider.ShowQuestion("Are you sure ?");
- //await NotificationProvider.ShowWarningQuestion("Are you really really sure ?", "YES, I'M", "SORRY");
}
finally
{