From 4cabb5aabc490156b50cd02592926539d48a7af8 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 15 Dec 2019 01:09:46 +0200 Subject: Implmented InternalModule navigation for PPC. Fixed issue with TangoIOC.GetAllInstancedByBase. Implemented PowerOff Screen. --- .../PPCApplication/DefaultPPCApplicationManager.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (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 206aa112b..149fb549f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -328,6 +328,8 @@ namespace Tango.PPC.UI.PPCApplication } } + var internalModules = this.GetType().Assembly.GetTypes().Where(xx => typeof(PPCModuleBase).IsAssignableFrom(xx)).ToList(); + LogManager.Log("Waiting for IPPCModuleLoader instance injection..."); TangoIOC.Default.GetInstanceWhenAvailable((loader) => { @@ -355,6 +357,19 @@ namespace Tango.PPC.UI.PPCApplication } } } + + //Adding internal modules. + LogManager.Log("Loading internal modules..."); + foreach (var type in internalModules) + { + var module = Activator.CreateInstance(type) as IPPCModule; + 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); + _moduleLoader.AllModules.Add(module); + _moduleLoader.UserModules.Add(module); + } }); LogManager.Log($"{loader.UserModules.Count} modules loaded."); -- cgit v1.3.1