From b76b75b9a455648114997ef611ead96bc68791a2 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 23 Feb 2020 16:34:40 +0200 Subject: Improved loading screen FSE. --- Software/Graphics/FSE/Abstracts/abstract2.png | Bin 0 -> 153795 bytes .../Tango.FSE.UI/Images/Abstracts/abstract2.png | Bin 0 -> 153795 bytes .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 3 +++ .../FSE/Tango.FSE.UI/ViewModels/LoadingViewVM.cs | 2 +- .../FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs | 20 ++++++++++++----- .../FSE/Tango.FSE.UI/Views/LoadingView.xaml | 25 +++++++++++++++++++-- 6 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 Software/Graphics/FSE/Abstracts/abstract2.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Abstracts/abstract2.png diff --git a/Software/Graphics/FSE/Abstracts/abstract2.png b/Software/Graphics/FSE/Abstracts/abstract2.png new file mode 100644 index 000000000..2742c71e5 Binary files /dev/null and b/Software/Graphics/FSE/Abstracts/abstract2.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Abstracts/abstract2.png b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Abstracts/abstract2.png new file mode 100644 index 000000000..2742c71e5 Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Abstracts/abstract2.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 4a2617fb0..04391b747 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -354,6 +354,9 @@ + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoadingViewVM.cs index 3438b3670..6f2693e5a 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoadingViewVM.cs @@ -31,7 +31,7 @@ namespace Tango.FSE.UI.ViewModels try { IsLoading = true; - await Task.Delay(1000); + await Task.Delay(2000); await GatewayService.GetEnvironments(); await NavigationManager.NavigateTo(NavigationView.LoginView); } 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 { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoadingView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoadingView.xaml index c29198f98..e7536ae42 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoadingView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoadingView.xaml @@ -9,9 +9,30 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LoadingViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoadingViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> - + + + + + + + - Loading, please wait... + Loading, please wait... -- cgit v1.3.1