diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-26 10:55:44 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-08-26 10:55:44 +0300 |
| commit | 6e2fbaffeec9d6e3518ea9706eea107a4f1b348c (patch) | |
| tree | f50b3d8962dd37188061f8f52c1a7aeff1642232 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs | |
| parent | db3dc558ec5fe5f3584081795865cd22f912da7d (diff) | |
| parent | e6704dce7a2b7f6d5f9bbf1b8374cc7f00ea061e (diff) | |
| download | Tango-6e2fbaffeec9d6e3518ea9706eea107a4f1b348c.tar.gz Tango-6e2fbaffeec9d6e3518ea9706eea107a4f1b348c.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs | 47 |
1 files changed, 8 insertions, 39 deletions
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..7c7e18276 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> @@ -237,31 +226,6 @@ namespace Tango.MachineStudio.UI.StudioApplication } /// <summary> - /// Loads the specified module if permitted. - /// </summary> - /// <param name="moduleName">Name of the module.</param> - /// <param name="args">The arguments.</param> - public void RequestModule(string moduleName, params object[] args) - { - IStudioModule module = _moduleLoader.UserModules.SingleOrDefault(x => x.Name == moduleName); - - if (module != null) - { - TangoIOC.Default.GetInstance<ViewModels.MainViewVM>().StartModule(module); - - //Notify request listeners. - foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<IStudioViewModel>()) - { - vm.OnModuleRequest(module, args); - } - } - else - { - throw new InvalidOperationException("The module was not found or you do not have sufficient privileges."); - } - } - - /// <summary> /// Notify the application manager about an external opened window. /// When application exists. All registered windows will be closed. /// </summary> @@ -305,5 +269,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()); + } } } |
