From 53db041e636bb3802dbe3cb911de6ef6ef41446c Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 24 Dec 2017 02:27:16 +0200 Subject: Continue for last commit. --- .../Tango.MachineStudio.UI/App.config | 8 ++ .../Tango.MachineStudio.UI/MainWindow.xaml.cs | 2 + .../Notifications/DefaultNotificationProvider.cs | 118 ++++++++++++++++----- .../Notifications/DialogWindow.xaml | 32 +++--- .../Notifications/DialogWindow.xaml.cs | 42 ++------ .../DefaultStudioApplicationManager.cs | 29 ++++- .../Tango.MachineStudio.UI.csproj | 23 ++++ .../Tango.MachineStudio.UI/ViewModelLocator.cs | 15 +++ .../ViewModels/MachineConnectionViewVM.cs | 55 ++++++++++ .../ViewModels/MainViewVM.cs | 73 ++++++++++++- .../Views/MachineConnectionView.xaml | 85 +++++++++++++++ .../Views/MachineConnectionView.xaml.cs | 34 ++++++ .../Tango.MachineStudio.UI/Views/MainView.xaml | 58 +++++++--- .../Tango.MachineStudio.UI/Views/MainView.xaml.cs | 6 +- .../Tango.MachineStudio.UI/packages.config | 1 + 15 files changed, 490 insertions(+), 91 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config index b31d56717..692b77528 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.config @@ -21,4 +21,12 @@ + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs index 9193cfd3e..dfbc0eb77 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs @@ -14,6 +14,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.Helpers; using Tango.MachineStudio.Common.StudioApplication; namespace Tango.MachineStudio.UI @@ -29,6 +30,7 @@ namespace Tango.MachineStudio.UI { InitializeComponent(); Instance = this; + ThreadsHelper.SetDisptacher(Dispatcher); this.Closing += MainWindow_Closing; } 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 b1ba03109..3c245510b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -35,32 +35,6 @@ namespace Tango.MachineStudio.UI.Notifications TaskItems = new ObservableCollection(); } - public bool ShowModalWindow(PackIconKind icon, string title, object context) where T : FrameworkElement - { - return ShowModalWindow(icon, title, Activator.CreateInstance(), context); - } - - public bool? ShowModalWindow(Window window) - { - window.Owner = Application.Current.MainWindow; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; - bool result = window.ShowDialog().Value; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; - return result; - } - - public bool ShowModalWindow(PackIconKind icon, string title, FrameworkElement content, object context) - { - DialogWindow dialog = new DialogWindow(content); - dialog.DataContext = context; - dialog.InnerTitle = title; - dialog.Owner = Application.Current.MainWindow; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; - bool result = dialog.ShowDialog().Value; - MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; - return result; - } - public bool? ShowDialog(PackIconKind icon, Brush iconColor, string message, bool hasCancel) { MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; @@ -79,6 +53,98 @@ namespace Tango.MachineStudio.UI.Notifications return result; } + public void ShowModalDialog(Action onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM + { + var view = Activator.CreateInstance(); + DialogWindow dialog = new DialogWindow(); + dialog.Owner = Application.Current.MainWindow; + dialog.InnerContent = view; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + view.Loaded += (x, y) => + { + VM context = view.DataContext as VM; + dialog.DataContext = context; + + Action onAcceptAction = null; + onAcceptAction = new Action(() => + { + dialog.Close(); + onAccept(context); + context.Accepted -= onAcceptAction; + }); + + Action onCancelAction = null; + onCancelAction = new Action(() => + { + dialog.Close(); + + if (onCancel != null) + { + onCancel(); + } + + context.Canceled -= onCancelAction; + }); + + context.Accepted += onAcceptAction; + context.Canceled += onCancelAction; + + context.OnShow(); + }; + dialog.ShowDialog(); + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } + + public void ShowModalDialog(Action onAccept, Action onCancel) where VM : DialogViewVM + { + 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; + DialogWindow dialog = new DialogWindow(); + dialog.Owner = Application.Current.MainWindow; + dialog.InnerContent = view; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + view.Loaded += (x, y) => + { + VM context = view.DataContext as VM; + dialog.DataContext = context; + + Action onAcceptAction = null; + onAcceptAction = new Action(() => + { + dialog.Close(); + onAccept(context); + context.Accepted -= onAcceptAction; + }); + + Action onCancelAction = null; + onCancelAction = new Action(() => + { + dialog.Close(); + + if (onCancel != null) + { + onCancel(); + } + + context.Canceled -= onCancelAction; + }); + + context.Accepted += onAcceptAction; + context.Canceled += onCancelAction; + + context.OnShow(); + }; + + dialog.ShowDialog(); + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } + + public void ShowModalDialog(Action onAccept) where VM : DialogViewVM + { + ShowModalDialog(onAccept, null); + } + public void ShowError(string message) { ShowDialog(PackIconKind.Exclamation, Brushes.Red, message, false); diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml index 2a8dd9f28..c11e2e11b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml @@ -1,4 +1,4 @@ - + Title="Machine Studio" MinHeight="220" SizeToContent="WidthAndHeight" MinWidth="600" AllowsTransparency="True" WindowStyle="None" WindowStartupLocation="CenterOwner" Background="Transparent"> - - - - - - - - - - - + + + + + + + + + + + + + - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs index 31dd3d644..d1bc0564b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DialogWindow.xaml.cs @@ -20,51 +20,23 @@ namespace Tango.MachineStudio.UI.Windows /// /// Interaction logic for DialogWindow.xaml /// - public partial class DialogWindow : MetroWindow + public partial class DialogWindow : Window { public DialogWindow() { InitializeComponent(); } - - - public String InnerTitle - { - get { return (String)GetValue(InnerTitleProperty); } - set { SetValue(InnerTitleProperty, value); } - } - public static readonly DependencyProperty InnerTitleProperty = - DependencyProperty.Register("InnerTitle", typeof(String), typeof(DialogWindow), new PropertyMetadata(null)); - - - - public PackIconKind IconKind + public FrameworkElement InnerContent { - get { return (PackIconKind)GetValue(IconKindProperty); } - set { SetValue(IconKindProperty, value); } + get { return (FrameworkElement)GetValue(InnerContentProperty); } + set { SetValue(InnerContentProperty, value); } } - public static readonly DependencyProperty IconKindProperty = - DependencyProperty.Register("IconKind", typeof(PackIconKind), typeof(DialogWindow), new PropertyMetadata(PackIconKind.Information)); - + // Using a DependencyProperty as the backing store for InnerContent. This enables animation, styling, binding, etc... + public static readonly DependencyProperty InnerContentProperty = + DependencyProperty.Register("InnerContent", typeof(FrameworkElement), typeof(DialogWindow), new PropertyMetadata(null)); - public DialogWindow(FrameworkElement content) : this() - { - presenter.Content = content; - } - - private void OnOKClicked(object sender, RoutedEventArgs e) - { - DialogResult = true; - Close(); - } - - private void OnCancelClicked(object sender, RoutedEventArgs e) - { - DialogResult = false; - Close(); - } } } 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 ea4234fd8..b0315e633 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -11,10 +11,13 @@ using Tango.MachineStudio.Common.Navigation; using GalaSoft.MvvmLight.Ioc; using System.Reflection; using System.Collections; +using Tango.Integration.Services; +using Tango.Core; +using Tango.Logging; namespace Tango.MachineStudio.UI.StudioApplication { - public class DefaultStudioApplicationManager : IStudioApplicationManager + public class DefaultStudioApplicationManager : ExtendedObject, IStudioApplicationManager { private INavigationManager _navigationManager; @@ -25,6 +28,19 @@ namespace Tango.MachineStudio.UI.StudioApplication public bool IsShuttingDown { get; private set; } + private IExternalBridgeClient _connectedMachine; + + public IExternalBridgeClient ConnectedMachine + { + get { return _connectedMachine; } + set { _connectedMachine = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsMachineConnected)); } + } + + public bool IsMachineConnected + { + get { return ConnectedMachine != null; } + } + public async void ShutDown() { if (IsShuttingDown) return; @@ -33,6 +49,17 @@ namespace Tango.MachineStudio.UI.StudioApplication await Task.Factory.StartNew(async () => { + try + { + if (ConnectedMachine != null) + { + ConnectedMachine.Disconnect().Wait(); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error disconnecting from machine."); + } //Do Shutdown Procedures... foreach (var vm in ServiceLocator.Current.GetAllInstancesByBase()) 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 fa04a1068..3becf0252 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 @@ -58,6 +58,9 @@ ..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll + + ..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + ..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll @@ -110,6 +113,7 @@ + @@ -119,6 +123,9 @@ LoginView.xaml + + MachineConnectionView.xaml + MainView.xaml @@ -159,6 +166,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -216,10 +227,18 @@ {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} Tango.Settings @@ -228,6 +247,10 @@ {8491d07b-c1f6-4b62-a412-41b9fd2d6538} Tango.SharedUI + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + {94f7acf8-55e1-4a02-b9bc-a818413fdbbf} Tango.MachineStudio.DB diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index f4a7a7502..e40f589af 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -2,6 +2,7 @@ using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Ioc; using Microsoft.Practices.ServiceLocation; using System; +using Tango.Integration.Services; using Tango.Logging; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Modules; @@ -48,17 +49,23 @@ namespace Tango.MachineStudio.UI SimpleIoc.Default.Unregister(); SimpleIoc.Default.Unregister(); SimpleIoc.Default.Unregister(); + SimpleIoc.Default.Unregister(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + + LogManager.RegisterLogger(new VSOutputLogger()); + LogManager.RegisterLogger(new FileLogger()); //Register View (Supervising Controller Pattern). if (!ViewModelBase.IsInDesignModeStatic) @@ -99,5 +106,13 @@ namespace Tango.MachineStudio.UI return ServiceLocator.Current.GetInstance(); } } + + public MachineConnectionViewVM MachineConnectionViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } } } \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs new file mode 100644 index 000000000..b8b888e86 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Integration.Services; +using Tango.MachineStudio.Common.Notifications; +using Tango.SharedUI; + +namespace Tango.MachineStudio.UI.ViewModels +{ + public class MachineConnectionViewVM : DialogViewVM + { + private ExternalBridgeScanner _scanner; + + public ExternalBridgeScanner Scanner + { + get { return _scanner; } + set { _scanner = value; RaisePropertyChangedAuto(); } + } + + private IExternalBridgeClient _selectedMachine; + + public IExternalBridgeClient SelectedMachine + { + get { return _selectedMachine; } + set { _selectedMachine = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public RelayCommand ConnectCommand { get; set; } + + public MachineConnectionViewVM(ExternalBridgeScanner scanner) + { + Scanner = scanner; + ConnectCommand = new RelayCommand(Connect,(x) => SelectedMachine != null); + Scanner.Start(); + } + + private void Connect() + { + if (SelectedMachine != null) + { + Accept(); + } + } + + public override void OnShow() + { + base.OnShow(); + + Scanner.AvailableMachines.Clear(); + } + } +} 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 a12156d60..6c44c8480 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -7,18 +7,24 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; +using Tango.Logging; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Modules; using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.Common.StudioApplication; using Tango.MachineStudio.UI.SupervisingController; +using Tango.MachineStudio.UI.Views; +using Tango.PMR.Stubs; using Tango.SharedUI; +using Tango.Transport.Adapters; namespace Tango.MachineStudio.UI.ViewModels { public class MainViewVM : ViewModel { private IStudioModule _currentModule; + private bool _isDisconnecting; public IStudioModule CurrentModule { @@ -47,6 +53,10 @@ namespace Tango.MachineStudio.UI.ViewModels public RelayCommand HomeCommand { get; set; } + public RelayCommand ConnectCommand { get; set; } + + public RelayCommand DisconnectCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; public IAuthenticationProvider AuthenticationProvider { @@ -70,20 +80,81 @@ namespace Tango.MachineStudio.UI.ViewModels set { _notificationProvider = value; RaisePropertyChangedAuto(); } } + private IStudioApplicationManager _applicationManager; + + public IStudioApplicationManager ApplicationManager + { + get { return _applicationManager; } + set { _applicationManager = value; RaisePropertyChangedAuto(); } + } + + public MainViewVM( IMainView view, IAuthenticationProvider authenticationProvider, IStudioModuleLoader studioModuleLoader, - INotificationProvider notificationProvider) : base(view) + INotificationProvider notificationProvider, + IStudioApplicationManager applicationManager) : base(view) { AuthenticationProvider = authenticationProvider; StudioModuleLoader = studioModuleLoader; NotificationProvider = notificationProvider; + ApplicationManager = applicationManager; StartModuleCommand = new RelayCommand(StartModule); HomeCommand = new RelayCommand(Home); + ConnectCommand = new RelayCommand(ConnectToMachine); + DisconnectCommand = new RelayCommand(DisconnectFromMachine,(x) => ApplicationManager.IsMachineConnected && !_isDisconnecting); + } + + private async void DisconnectFromMachine() + { + using (_notificationProvider.PushTaskItem("Disconnecting from machine...")) + { + _isDisconnecting = true; + InvalidateRelayCommands(); + await ApplicationManager.ConnectedMachine.Disconnect(); + ApplicationManager.ConnectedMachine = null; + _isDisconnecting = false; + InvalidateRelayCommands(); + } + } + + private void ConnectToMachine() + { + _notificationProvider.ShowModalDialog(async (x) => + { + if (x.SelectedMachine != null) + { + using (NotificationProvider.PushTaskItem("Connecting to machine " + x.SelectedMachine.SerialNumber + "...")) + { + try + { + await x.SelectedMachine.Connect(); + var authenticated = await x.SelectedMachine.Authenticate(); + if (!authenticated) + { + _notificationProvider.ShowError("It seems like you are not authorized to access the selected machine."); + } + else + { + ApplicationManager.ConnectedMachine = x.SelectedMachine; + var response = await x.SelectedMachine.SendRequest(new CalculateRequest() { A = 10, B = 5 }); + _notificationProvider.ShowInfo(response.ToString()); + } + } + catch (Exception ex) + { + LogManager.Log(ex); + _notificationProvider.ShowError(ex.Message); + } + } + } + + InvalidateRelayCommands(); + }); } private void Home() diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml new file mode 100644 index 000000000..2d172837a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + S/N: + + + IP Address: + + + Organization: + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..58cec1987 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MachineConnectionView.xaml.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.UI.Views +{ + /// + /// Interaction logic for MachineConnectionView.xaml + /// + public partial class MachineConnectionView : UserControl + { + public MachineConnectionView() + { + 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/MainView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml index aad1189b8..fc9db8adc 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/MainView.xaml @@ -26,7 +26,7 @@ - + @@ -84,17 +84,49 @@ x:Name="MenuToggleButton"/> - + + + @@ -189,7 +221,7 @@ - + @@ -204,16 +236,16 @@ - + - + - + - + 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 520b69741..f52393e1c 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 @@ -1,4 +1,5 @@ -using System; +using Microsoft.Practices.ServiceLocation; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -9,9 +10,12 @@ using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; +using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.UI.Notifications; using Tango.MachineStudio.UI.SupervisingController; using Tango.SharedUI; using Tango.SharedUI.Controls; diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config index 3a7265a72..25ad810bd 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/packages.config @@ -4,6 +4,7 @@ + -- cgit v1.3.1