From c256fc124a867707c787074c9076227341766794 Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 26 Feb 2023 14:09:42 +0200 Subject: eureka_ppc --- .../Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 9b57da988..7a5c51646 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -37,6 +37,7 @@ using Tango.PPC.Common.Synchronization; using Tango.Insights; using System.Threading; using System.Reflection; +using Tango.PPC.UI.ViewsContracts; namespace Tango.PPC.UI.PPCApplication { @@ -380,6 +381,8 @@ namespace Tango.PPC.UI.PPCApplication { LogManager.Log("Module loader instance has been registered. Registering for the ModulesLoaded event..."); + ILayoutView layoutView = TangoIOC.Default.GetInstance(); + loader.ModulesLoaded += (x, y) => { LogManager.Log("Loading modules views"); @@ -387,14 +390,14 @@ namespace Tango.PPC.UI.PPCApplication { foreach (var module in TangoIOC.Default.GetInstance().UserModules) { - if (!Views.LayoutView.Instance.NavigationControl.Elements.ToList().Exists(m => m.GetType() == module.MainViewType)) + if (!layoutView.GetNavigationControl().Elements.ToList().Exists(m => m.GetType() == module.MainViewType)) { try { LogManager.Log("Loading module view " + module.Name + "..."); FrameworkElement view = Activator.CreateInstance(module.MainViewType) as FrameworkElement; SharedUI.Controls.NavigationControl.SetNavigationName(view, module.Name); - Views.LayoutView.Instance.NavigationControl.Elements.Add(view); + layoutView.GetNavigationControl().Elements.Add(view); } catch (Exception ex) { @@ -411,7 +414,7 @@ namespace Tango.PPC.UI.PPCApplication LogManager.Log("Loading module view " + module.Name + "..."); FrameworkElement view = Activator.CreateInstance(module.MainViewType) as FrameworkElement; SharedUI.Controls.NavigationControl.SetNavigationName(view, module.Name); - Views.LayoutView.Instance.NavigationControl.Elements.Add(view); + layoutView.GetNavigationControl().Elements.Add(view); _moduleLoader.AllModules.Add(module); _moduleLoader.UserModules.Add(module); } -- cgit v1.3.1