diff options
| author | Roy <roy.mail.net@gmail.com> | 2017-12-26 21:16:15 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2017-12-26 21:16:15 +0200 |
| commit | 2ea2bb5bcd96045f1bd6cb4c3d8b8416dbaa05dc (patch) | |
| tree | a21ff27fff08876e835df82c5242def1f0d09c17 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI | |
| parent | 6450fc175114a6f8d0b75cb21386d1bb0c902711 (diff) | |
| download | Tango-2ea2bb5bcd96045f1bd6cb4c3d8b8416dbaa05dc.tar.gz Tango-2ea2bb5bcd96045f1bd6cb4c3d8b8416dbaa05dc.zip | |
MERGE
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
15 files changed, 211 insertions, 33 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config index 692b77528..d38c3ed69 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config @@ -27,6 +27,46 @@ <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> </assemblyBinding> </runtime> </configuration>
\ No newline at end of file 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 689ac7b38..9a8a6bc96 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs @@ -10,6 +10,7 @@ using Tango.Core; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Modules; +using Tango.MachineStudio.Stubs; namespace Tango.MachineStudio.UI.Modules { @@ -49,6 +50,10 @@ namespace Tango.MachineStudio.UI.Modules { if (!_loaded) { + //Preloaded + AllModules.Add(new StubsModule()); + //Preloaded + AllModules.Clear(); string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -63,8 +68,11 @@ namespace Tango.MachineStudio.UI.Modules { foreach (var moduleType in moduleAssembly.GetTypes().Where(x => !x.IsInterface && typeof(IStudioModule).IsAssignableFrom(x))) { - var module = Activator.CreateInstance(moduleType) as IStudioModule; - AllModules.Add(module); + if (!AllModules.ToList().Exists(x => x.GetType() == moduleType)) + { + var module = Activator.CreateInstance(moduleType) as IStudioModule; + AllModules.Add(module); + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs index 3c245510b..ede66dc19 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -15,6 +15,8 @@ namespace Tango.MachineStudio.UI.Notifications { public class DefaultNotificationProvider : ExtendedObject, INotificationProvider { + private static List<Type> viewTypes; + public ObservableCollection<TaskItem> TaskItems { get; private set; } public bool HasTaskItems @@ -99,7 +101,19 @@ namespace Tango.MachineStudio.UI.Notifications { String viewName = typeof(VM).Name.Replace("VM", ""); - var view = Activator.CreateInstance(AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypes()).Single(x => x.Name == viewName)) as FrameworkElement; + if (viewTypes == null) + { + viewTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypes()).ToList(); + } + + var viewType = viewTypes.SingleOrDefault(x => x.Name == viewName); + + if (viewType == null) + { + throw new NullReferenceException("Could not locate view " + viewName); + } + + var view = Activator.CreateInstance(viewType) as FrameworkElement; DialogWindow dialog = new DialogWindow(); dialog.Owner = Application.Current.MainWindow; dialog.InnerContent = view; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml index 4f3b826fe..a89f8eeca 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/MessageBoxWindow.xaml @@ -24,7 +24,7 @@ <Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Click="OnOKClicked"> ACCEPT </Button> - <Button Visibility="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=HasCancel,Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Click="OnCancelClicked"> + <Button Visibility="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=HasCancel,Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="False" Margin="0 8 8 0" Click="OnCancelClicked"> CANCEL </Button> </StackPanel> 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 355d59083..89823e4f7 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 @@ -77,9 +77,27 @@ <HintPath>..\..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="System.ComponentModel.Composition" /> <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> + <Reference Include="System.Numerics" /> + <Reference Include="System.Reactive.Core, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.Interfaces, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.Linq, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.PlatformServices, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Reactive.PlatformServices.3.1.1\lib\net46\System.Reactive.PlatformServices.dll</HintPath> + </Reference> + <Reference Include="System.Reactive.Windows.Threading, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> + <HintPath>..\..\packages\System.Reactive.Windows.Threading.3.1.1\lib\net45\System.Reactive.Windows.Threading.dll</HintPath> + </Reference> + <Reference Include="System.Windows" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <HintPath>..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath> @@ -114,6 +132,7 @@ <Compile Include="ViewModels\LoadingViewVM.cs" /> <Compile Include="ViewModels\LoginViewVM.cs" /> <Compile Include="ViewModels\MachineConnectionViewVM.cs" /> + <Compile Include="ViewModels\MachineLoginViewVM.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> <Compile Include="ViewModelLocator.cs" /> <Compile Include="ViewModels\ShutdownViewVM.cs" /> @@ -262,6 +281,10 @@ <Project>{94f7acf8-55e1-4a02-b9bc-a818413fdbbf}</Project> <Name>Tango.MachineStudio.DB</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> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index e40f589af..70912ba98 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -63,6 +63,7 @@ namespace Tango.MachineStudio.UI SimpleIoc.Default.Register<ShutdownViewVM>(); SimpleIoc.Default.Register<LoginViewVM>(); SimpleIoc.Default.Register<MachineConnectionViewVM>(); + SimpleIoc.Default.Register<MachineLoginViewVM>(); LogManager.RegisterLogger(new VSOutputLogger()); LogManager.RegisterLogger(new FileLogger()); @@ -114,5 +115,13 @@ namespace Tango.MachineStudio.UI return ServiceLocator.Current.GetInstance<MachineConnectionViewVM>(); } } + + public MachineLoginViewVM MachineLoginViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MachineLoginViewVM>(); + } + } } }
\ 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 6505bcf88..f213af0d4 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs @@ -31,7 +31,6 @@ namespace Tango.MachineStudio.UI.ViewModels { StaThreadHelper.StartStaThread(() => { - Thread.Sleep(1000); try { ObservablesEntitiesAdapter.Instance.Initialize(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs new file mode 100644 index 000000000..a6ee9ee2a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineLoginViewVM.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.UI.ViewModels +{ + public class MachineLoginViewVM : DialogViewVM + { + public String Password { get; set; } + + public RelayCommand<String> LoginCommand { get; set; } + + public RelayCommand CancelCommand { get; set; } + + public MachineLoginViewVM() + { + LoginCommand = new RelayCommand<string>(Login); + CancelCommand = new RelayCommand(Cancel); + } + + private void Login(string password) + { + Password = password; + Accept(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index 6c44c8480..92c0afa21 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -124,33 +124,38 @@ namespace Tango.MachineStudio.UI.ViewModels private void ConnectToMachine() { - _notificationProvider.ShowModalDialog<MachineConnectionViewVM>(async (x) => + _notificationProvider.ShowModalDialog<MachineConnectionViewVM>((x) => { if (x.SelectedMachine != null) { - using (NotificationProvider.PushTaskItem("Connecting to machine " + x.SelectedMachine.SerialNumber + "...")) + _notificationProvider.ShowModalDialog<MachineLoginViewVM>(async (login) => { - try + using (NotificationProvider.PushTaskItem("Connecting to machine " + x.SelectedMachine.SerialNumber + "...")) { - await x.SelectedMachine.Connect(); - var authenticated = await x.SelectedMachine.Authenticate(); - if (!authenticated) + try { - _notificationProvider.ShowError("It seems like you are not authorized to access the selected machine."); + await x.SelectedMachine.Connect(); + var authenticated = await x.SelectedMachine.Authenticate(login.Password); + if (!authenticated) + { + _notificationProvider.ShowError("It seems like you are not authorized to access the selected machine."); + } + else + { + ApplicationManager.ConnectedMachine = x.SelectedMachine; + } } - else + catch (Exception ex) { - ApplicationManager.ConnectedMachine = x.SelectedMachine; - var response = await x.SelectedMachine.SendRequest<CalculateRequest, CalculateResponse>(new CalculateRequest() { A = 10, B = 5 }); - _notificationProvider.ShowInfo(response.ToString()); + LogManager.Log(ex); + _notificationProvider.ShowError(ex.Message); } + + InvalidateRelayCommands(); } - catch (Exception ex) - { - LogManager.Log(ex); - _notificationProvider.ShowError(ex.Message); - } - } + }); + + InvalidateRelayCommands(); } InvalidateRelayCommands(); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml index 2d172837a..32108c652 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml @@ -77,7 +77,7 @@ </Grid> <Grid Grid.Row="1"> - <Button HorizontalAlignment="Right" Width="140" Command="{Binding ConnectCommand}" Click="OnConnectClicked">CONNECT</Button> + <Button HorizontalAlignment="Right" Width="140" Command="{Binding ConnectCommand}">CONNECT</Button> </Grid> </Grid> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs index 58cec1987..6c8e305e9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs @@ -24,11 +24,5 @@ namespace Tango.MachineStudio.UI.Views { InitializeComponent(); } - - private void OnConnectClicked(object sender, RoutedEventArgs e) - { - Window.GetWindow(this).DialogResult = true; - Window.GetWindow(this).Close(); - } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml index 83f7cc884..04f787c41 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml @@ -3,10 +3,37 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300"> + d:DesignHeight="200" d:DesignWidth="550" Background="White" DataContext="{Binding MachineLoginViewVM, Source={StaticResource Locator}}"> <Grid> - + <DockPanel LastChildFill="True"> + <StackPanel Margin="10" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right" DockPanel.Dock="Bottom"> + <Button Command="{Binding LoginCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=Password}" Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0"> + LOGIN + </Button> + <Button Command="{Binding CancelCommand}" Style="{StaticResource MaterialDesignFlatButton}" Margin="0 8 0 0"> + CANCEL + </Button> + </StackPanel> + <Grid Margin="10"> + <StackPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Top"> + <Grid> + <Image Source="../Images/machine-trans.png" Width="42" RenderOptions.BitmapScalingMode="Fant"></Image> + <materialDesign:PackIcon Kind="Lock" VerticalAlignment="Bottom" Width="24" Height="24" HorizontalAlignment="Right" Foreground="{StaticResource AccentColorBrush}" /> + </Grid> + <TextBlock Padding="0 10 0 0" TextWrapping="Wrap" Margin="10 0 0 0" VerticalAlignment="Top" FontSize="18" Text="Machine Login" Width="400"></TextBlock> + </StackPanel> + + <StackPanel Margin="60 0 0 0"> + <TextBlock Margin="0 15 0 0">Enter machine password</TextBlock> + <PasswordBox x:Name="txtPass" Margin="0 0 0 0" HorizontalAlignment="Left" PasswordChanged="txtPass_PasswordChanged" materialDesign:HintAssist.FloatingScale="0.50" materialDesign:HintAssist.Hint="*********" Width="300" materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}" /> + </StackPanel> + </StackPanel> + </Grid> + </DockPanel> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml.cs index c0bfdc25d..c5161b477 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineLoginView.xaml.cs @@ -23,6 +23,29 @@ namespace Tango.MachineStudio.UI.Views public MachineLoginView() { InitializeComponent(); + + this.Loaded += MachineLoginView_Loaded; + } + + private void MachineLoginView_Loaded(object sender, RoutedEventArgs e) + { + txtPass.Focusable = true; + txtPass.Focus(); + txtPass.Password = String.Empty; + Password = String.Empty; + } + + public String Password + { + get { return (String)GetValue(PasswordProperty); } + set { SetValue(PasswordProperty, value); } + } + public static readonly DependencyProperty PasswordProperty = + DependencyProperty.Register("Password", typeof(String), typeof(MachineLoginView), new PropertyMetadata(null)); + + private void txtPass_PasswordChanged(object sender, RoutedEventArgs e) + { + Password = txtPass.Password; } } } 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 fc9db8adc..14858c049 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -86,9 +86,8 @@ <StackPanel> <Button Content="Machine Connection" Command="{Binding ConnectCommand}" /> <Button Content="Disconnect Machine" Command="{Binding DisconnectCommand}" /> - <Button Content="Exit" /> <Separator/> - <Button Content="Goodbye"/> + <Button Content="Exit" /> </StackPanel> </materialDesign:PopupBox> <Grid> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config index 25ad810bd..ae67b1d1c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config @@ -11,4 +11,10 @@ <package id="MvvmLight" version="5.3.0.0" targetFramework="net46" /> <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" /> <package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" /> + <package id="System.Reactive" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.Core" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.Interfaces" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.Linq" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.PlatformServices" version="3.1.1" targetFramework="net46" /> + <package id="System.Reactive.Windows.Threading" version="3.1.1" targetFramework="net46" /> </packages>
\ No newline at end of file |
