diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs | 9 |
1 files changed, 6 insertions, 3 deletions
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<ILayoutView>(); + 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<IPPCModuleLoader>().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); } |
