aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-08-20 19:43:15 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-08-20 19:43:15 +0300
commit51afc4f6a17383e91a72c2ce060e82604d43c3a8 (patch)
treec0aa029d9864fc8f03b69716a42eda5efe65ccd5 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI
parent2ea6653199844f5607d17a8912eb7a99e2471610 (diff)
downloadTango-51afc4f6a17383e91a72c2ce060e82604d43c3a8.tar.gz
Tango-51afc4f6a17383e91a72c2ce060e82604d43c3a8.zip
Working on new Machine Studio DB.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs44
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs25
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs22
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj34
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs41
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml43
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml1
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs6
9 files changed, 114 insertions, 104 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
index 4e5425138..de84e43e8 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -9,6 +9,7 @@ using Tango.BL.Entities;
using Tango.MachineStudio.Common.Authentication;
using Tango.BL;
using Tango.BL.Enumerations;
+using System.Data.Entity;
namespace Tango.MachineStudio.UI.Authentication
{
@@ -48,32 +49,39 @@ namespace Tango.MachineStudio.UI.Authentication
/// <exception cref="AuthenticationException">Login failed for user " + email</exception>
public User Login(string email, string password)
{
- String hash = User.GetPasswordHash(password);
+ using (ObservablesContext db = ObservablesContext.CreateDefault())
+ {
+ db.Configuration.LazyLoadingEnabled = false;
- User user = ObservablesEntitiesAdapter.Instance.Users.SingleOrDefault(x => x.Email.ToLower() == email.ToLower() && x.Password == hash);
+ String hash = User.GetPasswordHash(password);
- if (user == null)
- {
- throw new AuthenticationException("Invalid credentials for " + email);
- }
+ db.Roles.Load();
+ db.Permissions.Load();
+ db.RolesPermissions.Load();
- if (!user.HasPermission(Permissions.RunMachineStudio))
- {
- throw new AuthenticationException("It seems like you do not have sufficient privileges to run Machine Studio. Please contact your administrator.");
- }
+ User user = db.Users
+ .Include(x => x.UsersRoles)
+ .Include(x => x.Organization).SingleOrDefault(x => x.Email.ToLower() == email.ToLower() && x.Password == hash);
- if (user != null)
- {
- using (ObservablesContext db = ObservablesContext.CreateDefault())
+ if (user == null)
+ {
+ throw new AuthenticationException("Invalid credentials for " + email);
+ }
+
+ if (!user.HasPermission(Permissions.RunMachineStudio))
{
- var u = db.Users.Single(x => x.Guid == user.Guid);
- u.LastLogin = DateTime.UtcNow;
+ throw new AuthenticationException("It seems like you do not have sufficient privileges to run Machine Studio. Please contact your administrator.");
+ }
+
+ if (user != null)
+ {
+ user.LastLogin = DateTime.UtcNow;
db.SaveChanges();
}
- }
- CurrentUser = user;
- return user;
+ CurrentUser = user;
+ return user;
+ }
}
/// <summary>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs
index 26a789d0f..13c3d6779 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs
@@ -12,9 +12,6 @@ using Tango.Logging;
using Tango.MachineStudio.Common;
using Tango.MachineStudio.Common.Authentication;
using Tango.MachineStudio.Common.Modules;
-using Tango.MachineStudio.DB;
-using Tango.MachineStudio.MachineDesigner;
-using Tango.MachineStudio.Stubs;
namespace Tango.MachineStudio.UI.Modules
{
@@ -27,7 +24,6 @@ namespace Tango.MachineStudio.UI.Modules
{
private IAuthenticationProvider _authenticationProvider;
private bool _loaded;
- public event EventHandler ModulesLoaded;
/// <summary>
/// Initializes a new instance of the <see cref="DefaultStudioModuleLoader"/> class.
@@ -78,15 +74,15 @@ namespace Tango.MachineStudio.UI.Modules
{
if (!_loaded)
{
- //Preloaded
+ ////Preloaded
- LogManager.Log(String.Format("Loading module '{0}'...", nameof(StubsModule)));
- AllModules.Add(new StubsModule());
- LogManager.Log(String.Format("Loading module '{0}'...", nameof(DBModule)));
- AllModules.Add(new DBModule());
- LogManager.Log(String.Format("Loading module '{0}'...", nameof(MachineDesignerModule)));
- AllModules.Add(new MachineDesignerModule());
- //Preloaded
+ //LogManager.Log(String.Format("Loading module '{0}'...", nameof(StubsModule)));
+ //AllModules.Add(new StubsModule());
+ //LogManager.Log(String.Format("Loading module '{0}'...", nameof(DBModule)));
+ //AllModules.Add(new DBModule());
+ //LogManager.Log(String.Format("Loading module '{0}'...", nameof(MachineDesignerModule)));
+ //AllModules.Add(new MachineDesignerModule());
+ ////Preloaded
AllModules.Clear();
string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
@@ -146,5 +142,10 @@ namespace Tango.MachineStudio.UI.Modules
{
return UserModules.OfType<T>().FirstOrDefault();
}
+
+ /// <summary>
+ /// Occurs when all modules are initialized.
+ /// </summary>
+ public event EventHandler ModulesLoaded;
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
index ee9337eb3..b8e6e1670 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -43,21 +43,10 @@ namespace Tango.MachineStudio.UI.StudioApplication
_navigationManager = navigationManager;
_openedWindows = new List<Window>();
- Task.Factory.StartNew(() =>
+ Application.Current.MainWindow.ContentRendered += (_, __) =>
{
- while (MainWindow.Instance == null)
- {
- Thread.Sleep(100);
- }
-
- InvokeUI(() =>
- {
- MainWindow.Instance.ContentRendered += (_, __) =>
- {
- TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>().ToList().ForEach(x => x.OnApplicationStarted());
- };
- });
- });
+ TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>().ToList().ForEach(x => x.OnApplicationStarted());
+ };
}
/// <summary>
@@ -305,5 +294,10 @@ namespace Tango.MachineStudio.UI.StudioApplication
return EmbeddedResourceHelper.GetEmbeddedResourceText("Tango.MachineStudio.UI.ChangeLog.txt");
}
}
+
+ public void NotifyApplicationReady()
+ {
+ TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>().ToList().ForEach(x => x.OnApplicationReady());
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
index 724f83680..1a5de40e1 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj
@@ -400,26 +400,10 @@
<Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project>
<Name>Tango.Transport</Name>
</ProjectReference>
- <ProjectReference Include="..\Modules\Tango.MachineStudio.ColorLab\Tango.MachineStudio.ColorLab.csproj">
- <Project>{4d183aca-552b-4135-ae81-7c5a8e5fc3b1}</Project>
- <Name>Tango.MachineStudio.ColorLab</Name>
- </ProjectReference>
- <ProjectReference Include="..\Modules\Tango.MachineStudio.DataCapture\Tango.MachineStudio.DataCapture.csproj">
- <Project>{fc337a7f-1214-41d8-9992-78092a3b961e}</Project>
- <Name>Tango.MachineStudio.DataCapture</Name>
- </ProjectReference>
- <ProjectReference Include="..\Modules\Tango.MachineStudio.DB\Tango.MachineStudio.DB.csproj">
- <Project>{94f7acf8-55e1-4a02-b9bc-a818413fdbbf}</Project>
- <Name>Tango.MachineStudio.DB</Name>
- </ProjectReference>
<ProjectReference Include="..\Modules\Tango.MachineStudio.Developer\Tango.MachineStudio.Developer.csproj">
<Project>{ce4a0d11-08a2-4cd6-9908-d6c62e80d805}</Project>
<Name>Tango.MachineStudio.Developer</Name>
</ProjectReference>
- <ProjectReference Include="..\Modules\Tango.MachineStudio.HardwareDesigner\Tango.MachineStudio.HardwareDesigner.csproj">
- <Project>{69db0564-268c-4b3c-b5d6-a3cdc7d14eae}</Project>
- <Name>Tango.MachineStudio.HardwareDesigner</Name>
- </ProjectReference>
<ProjectReference Include="..\Modules\Tango.MachineStudio.Logging\Tango.MachineStudio.Logging.csproj">
<Project>{1674f726-0e66-414f-b9fd-c6f20d7f07c7}</Project>
<Name>Tango.MachineStudio.Logging</Name>
@@ -428,22 +412,6 @@
<Project>{d0ce8122-077d-42a2-9490-028ae4769b52}</Project>
<Name>Tango.MachineStudio.MachineDesigner</Name>
</ProjectReference>
- <ProjectReference Include="..\Modules\Tango.MachineStudio.Stubs\Tango.MachineStudio.Stubs.csproj">
- <Project>{22c2aa72-9493-4d0d-b421-8ef9789fb192}</Project>
- <Name>Tango.MachineStudio.Stubs</Name>
- </ProjectReference>
- <ProjectReference Include="..\Modules\Tango.MachineStudio.Synchronization\Tango.MachineStudio.Synchronization.csproj">
- <Project>{12d0c43c-391f-4c74-92ab-82e9a9beeb9b}</Project>
- <Name>Tango.MachineStudio.Synchronization</Name>
- </ProjectReference>
- <ProjectReference Include="..\Modules\Tango.MachineStudio.Technician\Tango.MachineStudio.Technician.csproj">
- <Project>{5d39c1e1-3ecd-4634-bd1b-2bcf71c54a15}</Project>
- <Name>Tango.MachineStudio.Technician</Name>
- </ProjectReference>
- <ProjectReference Include="..\Modules\Tango.MachineStudio.UsersAndRoles\Tango.MachineStudio.UsersAndRoles.csproj">
- <Project>{88028f14-0028-4ded-b119-19b8ee23cf32}</Project>
- <Name>Tango.MachineStudio.UsersAndRoles</Name>
- </ProjectReference>
<ProjectReference Include="..\Tango.MachineStudio.Common\Tango.MachineStudio.Common.csproj">
<Project>{cb0b0aa2-bb24-4bca-a720-45e397684e12}</Project>
<Name>Tango.MachineStudio.Common</Name>
@@ -577,7 +545,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\vcruntime140d.dll" "$(TargetDir)"</
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_UpdateFileVersion="True" BuildVersion_DetectChanges="True" BuildVersion_UseGlobalSettings="False" />
+ <UserProperties BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="True" BuildVersion_UpdateFileVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
index a468dc2e7..eacc8a4cb 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
@@ -141,7 +141,7 @@ namespace Tango.MachineStudio.UI.ViewModels
Status = "Loading, please wait...";
- ObservablesEntitiesAdapter.Instance.Initialize();
+ ObservablesStaticCollections.Instance.Initialize();
_eventLogger.Log(EventTypes.ApplicationStarted, "Application Started!");
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 f2a4f1143..a37879a5e 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs
@@ -51,6 +51,15 @@ namespace Tango.MachineStudio.UI.ViewModels
set { _password = value; RaisePropertyChangedAuto(); }
}
+ private bool _isLogging;
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is logging.
+ /// </summary>
+ public bool IsLogging
+ {
+ get { return _isLogging; }
+ set { _isLogging = value; RaisePropertyChangedAuto(); }
+ }
private bool _rememberMe;
/// <summary>
@@ -81,7 +90,7 @@ namespace Tango.MachineStudio.UI.ViewModels
_navigationManager = navigationManager;
_authenticationProvider = authenticationProvider;
_eventLogger = eventLogger;
- LoginCommand = new RelayCommand(Login);
+ LoginCommand = new RelayCommand(Login,() => !IsLogging);
cryptographer = new Rfc2898Cryptographer();
Email = _settings.LastLoginEmail;
@@ -100,26 +109,38 @@ namespace Tango.MachineStudio.UI.ViewModels
/// <summary>
/// Logins the requested user.
/// </summary>
- private void Login()
+ private async void Login()
{
if (Validate())
{
try
{
- _authenticationProvider.Login(Email, Password);
- _navigationManager.NavigateTo(NavigationView.MainView);
- _settings.LastLoginEmail = Email;
- _settings.RememberMe = RememberMe;
+ IsLogging = true;
+ InvalidateRelayCommands();
- _settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null;
- _settings.Save();
+ await Task.Factory.StartNew(() =>
+ {
+ _authenticationProvider.Login(Email, Password);
+ _navigationManager.NavigateTo(NavigationView.MainView);
+ _settings.LastLoginEmail = Email;
+ _settings.RememberMe = RememberMe;
- _eventLogger.Log("User logged in");
+ _settings.LastLoginPassword = RememberMe ? cryptographer.Encrypt(Password) : null;
+ _settings.Save();
+
+ _eventLogger.Log("User logged in");
+ });
}
- catch
+ catch (Exception)
{
+
_notificationProvider.ShowError("Invalid credentials. Please try again.");
}
+ finally
+ {
+ IsLogging = false;
+ InvalidateRelayCommands();
+ }
}
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
index 08e1006c1..68334ad24 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/LoginView.xaml
@@ -5,7 +5,9 @@
xmlns:rules="clr-namespace:Tango.MachineStudio.Common.ValidationRules;assembly=Tango.MachineStudio.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:automation="clr-namespace:Tango.MachineStudio.Common.Automation;assembly=Tango.MachineStudio.Common"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
mc:Ignorable="d"
@@ -13,6 +15,8 @@
<UserControl.Resources>
<rules:Required x:Key="Required"></rules:Required>
+ <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
+ <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
</UserControl.Resources>
@@ -24,21 +28,30 @@
<Image Source="/Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant" Width="100"></Image>
<TextBlock Margin="20 0 0 0" VerticalAlignment="Center" FontSize="70" Foreground="{StaticResource AccentColorBrush}">Machine Studio</TextBlock>
</StackPanel>
- <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="320" Margin="0 120 0 0">
- <TextBlock HorizontalAlignment="Center" FontSize="24">Login to your account</TextBlock>
- <Image Source="/Images/account.png" RenderOptions.BitmapScalingMode="Fant" Width="100" Margin="0 20 0 0"></Image>
- <DockPanel Margin="0 20 0 0">
- <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtEmail, Path=BorderBrush}" Kind="EmailOutline" />
- <TextBox x:Name="txtEmail" IsTabStop="True" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Email" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding Email,UpdateSourceTrigger=PropertyChanged,ValidatesOnNotifyDataErrors=True}" AutomationProperties.IsRequiredForForm="True" />
- </DockPanel>
- <DockPanel Margin="0 20 0 0">
- <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtPass, Path=BorderBrush}" Kind="Key" />
- <PasswordBox x:Name="txtPass" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Password" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" AutomationProperties.IsRequiredForForm="True" />
- </DockPanel>
- <CheckBox Margin="25 20 0 0" IsChecked="{Binding RememberMe}">Remember me</CheckBox>
- <Button AutomationProperties.AutomationId="{x:Static automation:UI.LoginButton}" Margin="25 20 0 0" Height="50" Command="{Binding LoginCommand}" Content="LOGIN">
+ <DockPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="320" Margin="0 120 0 0" Height="398">
- </Button>
- </StackPanel>
+ <Button DockPanel.Dock="Bottom" AutomationProperties.AutomationId="{x:Static automation:UI.LoginButton}" Margin="25 20 0 0" Height="50" Command="{Binding LoginCommand}" Content="LOGIN"></Button>
+
+ <Grid>
+ <StackPanel Visibility="{Binding IsLogging,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <TextBlock HorizontalAlignment="Center" FontSize="24">Login to your account</TextBlock>
+ <Image Source="/Images/account.png" RenderOptions.BitmapScalingMode="Fant" Width="100" Margin="0 20 0 0"></Image>
+ <DockPanel Margin="0 20 0 0">
+ <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtEmail, Path=BorderBrush}" Kind="EmailOutline" />
+ <TextBox x:Name="txtEmail" IsTabStop="True" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Email" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintTextBox}" Text="{Binding Email,UpdateSourceTrigger=PropertyChanged,ValidatesOnNotifyDataErrors=True}" AutomationProperties.IsRequiredForForm="True" />
+ </DockPanel>
+ <DockPanel Margin="0 20 0 0">
+ <materialDesign:PackIcon Margin="0 0 0 0" Width="20" Height="20" VerticalAlignment="Top" Foreground="{Binding ElementName=txtPass, Path=BorderBrush}" Kind="Key" />
+ <PasswordBox x:Name="txtPass" helpers:PasswordHelper.Attach="True" helpers:PasswordHelper.Password="{Binding Password,Mode=TwoWay}" Margin="5 0 0 0" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="Password" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" FontSize="20" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" AutomationProperties.IsRequiredForForm="True" />
+ </DockPanel>
+ <CheckBox Margin="25 20 0 0" IsChecked="{Binding RememberMe}">Remember me</CheckBox>
+ </StackPanel>
+
+ <StackPanel Visibility="{Binding IsLogging,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Center">
+ <mahapps:ProgressRing Width="80" Height="80" IsActive="{Binding IsLogging}"></mahapps:ProgressRing>
+ <TextBlock HorizontalAlignment="Center" Margin="0 30 0 0" FontSize="18" FontStyle="Italic">Logging you in...</TextBlock>
+ </StackPanel>
+ </Grid>
+ </DockPanel>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
index 7044ad32e..bb5c6458b 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml
@@ -12,7 +12,6 @@
xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views;assembly=Tango.MachineStudio.DB"
xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views"
xmlns:commonConverters="clr-namespace:Tango.MachineStudio.Common.Converters;assembly=Tango.MachineStudio.Common"
mc:Ignorable="d"
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs
index 1e894f3f2..7ed119abd 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml.cs
@@ -27,6 +27,7 @@ using Tango.SharedUI.Helpers;
using Tango.Logging;
using static Tango.SharedUI.Controls.NavigationControl;
using Tango.Core.DI;
+using Tango.MachineStudio.Common.StudioApplication;
namespace Tango.MachineStudio.UI.Views
{
@@ -84,6 +85,11 @@ namespace Tango.MachineStudio.UI.Views
}
item.Pop();
+
+ ThreadsHelper.InvokeUI(() =>
+ {
+ TangoIOC.Default.GetInstance<IStudioApplicationManager>().NotifyApplicationReady();
+ });
});
}
}