diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs | 11 |
1 files changed, 10 insertions, 1 deletions
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 3f7d4cad8..9193cfd3e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs @@ -1,4 +1,5 @@ using MahApps.Metro.Controls; +using Microsoft.Practices.ServiceLocation; using System; using System.Collections.Generic; using System.Linq; @@ -13,6 +14,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.MachineStudio.Common.StudioApplication; namespace Tango.MachineStudio.UI { @@ -26,8 +28,15 @@ namespace Tango.MachineStudio.UI public MainWindow() { InitializeComponent(); - Instance = this; + + this.Closing += MainWindow_Closing; + } + + private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) + { + e.Cancel = true; + ServiceLocator.Current.GetInstance<IStudioApplicationManager>().ShutDown(); } } } |
