From 51afc4f6a17383e91a72c2ce060e82604d43c3a8 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 20 Aug 2018 19:43:15 +0300 Subject: Working on new Machine Studio DB. --- .../DefaultStudioApplicationManager.cs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication') 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(); - Task.Factory.StartNew(() => + Application.Current.MainWindow.ContentRendered += (_, __) => { - while (MainWindow.Instance == null) - { - Thread.Sleep(100); - } - - InvokeUI(() => - { - MainWindow.Instance.ContentRendered += (_, __) => - { - TangoIOC.Default.GetAllInstancesByBase().ToList().ForEach(x => x.OnApplicationStarted()); - }; - }); - }); + TangoIOC.Default.GetAllInstancesByBase().ToList().ForEach(x => x.OnApplicationStarted()); + }; } /// @@ -305,5 +294,10 @@ namespace Tango.MachineStudio.UI.StudioApplication return EmbeddedResourceHelper.GetEmbeddedResourceText("Tango.MachineStudio.UI.ChangeLog.txt"); } } + + public void NotifyApplicationReady() + { + TangoIOC.Default.GetAllInstancesByBase().ToList().ForEach(x => x.OnApplicationReady()); + } } } -- cgit v1.3.1