diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-23 16:34:40 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-23 16:34:40 +0200 |
| commit | b76b75b9a455648114997ef611ead96bc68791a2 (patch) | |
| tree | 1ad3c6ed2a856284ca0ecd3b051d5287727b0cc4 /Software | |
| parent | 84c6b6dc548751769db3d489effe2f5f5df2d08d (diff) | |
| download | Tango-b76b75b9a455648114997ef611ead96bc68791a2.tar.gz Tango-b76b75b9a455648114997ef611ead96bc68791a2.zip | |
Improved loading screen FSE.
Diffstat (limited to 'Software')
| -rw-r--r-- | Software/Graphics/FSE/Abstracts/abstract2.png | bin | 0 -> 153795 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Abstracts/abstract2.png | bin | 0 -> 153795 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 3 | ||||
| -rw-r--r-- | Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoadingViewVM.cs | 2 | ||||
| -rw-r--r-- | Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs | 20 | ||||
| -rw-r--r-- | Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LoadingView.xaml | 25 |
6 files changed, 42 insertions, 8 deletions
diff --git a/Software/Graphics/FSE/Abstracts/abstract2.png b/Software/Graphics/FSE/Abstracts/abstract2.png Binary files differnew file mode 100644 index 000000000..2742c71e5 --- /dev/null +++ b/Software/Graphics/FSE/Abstracts/abstract2.png 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 Binary files differnew file mode 100644 index 000000000..2742c71e5 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Abstracts/abstract2.png 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 @@ <ItemGroup> <Resource Include="Images\Statuses\standby_Anim.gif" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\Abstracts\abstract2.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets" Condition="Exists('..\..\packages\MaterialDesignThemes.3.0.1\build\MaterialDesignThemes.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> 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}"> <Grid> - <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> + <Image Source="/Images/Abstracts/abstract2.png" RenderTransformOrigin="0.5,0.5" Height="350" HorizontalAlignment="Left" Stretch="UniformToFill" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ActualWidth,Converter={StaticResource MathOperatorConverter},ConverterParameter='+100'}" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Bottom"> + <Image.Style> + <Style TargetType="Image"> + <Setter Property="Margin" Value="0 0 0 0"></Setter> + <Setter Property="Opacity" Value="0.8"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsLoading}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <ThicknessAnimation Storyboard.TargetProperty="Margin" To="-100 0 0 0" Duration="00:00:05" /> + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.2" Duration="00:00:05" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> + <Image Source="{StaticResource FSE_Twine_Logo}" HorizontalAlignment="Left" VerticalAlignment="Top" RenderOptions.BitmapScalingMode="Fant" Stretch="Uniform" Margin="20" Width="300"></Image> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 -100 0 0"> <ProgressBar Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="{Binding IsLoading}" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" /> - <TextBlock FontSize="30" Margin="0 30 0 0">Loading, please wait...</TextBlock> + <TextBlock FontSize="20" Margin="0 30 0 0">Loading, please wait...</TextBlock> </StackPanel> </Grid> </UserControl> |
