/// <summary>
        /// Initializes a new instance of the <see cref="ModulesNavigationView"/> class. 
        /// </summary>
        /// <param name="navigationManager">The navigation manager.</param>
        public ModulesNavigationView(NavigationManager navigationManager)
        {
            navigationSettingsList = new Dictionary<string, NavigationSettings>();
            this.navigationManager = navigationManager;

            InitializeComponent();

            navigationPanel.ItemSelected += SelectedModuleListItem;
        }
Example #2
0
        /// <summary>
        /// Instantiates a new instance of the ModuleManager class. During instantiation  
        /// the <see cref="ModulesNavigationView"/> is registered with Unity and loaded 
        /// using Prism. 
        /// </summary>
        /// <param name="container">The unity container which is used to register the <see cref="ModulesNavigationView"/> class.</param>
        /// <param name="navigationManager">Loads the <see cref="ModulesNavigationView"/> class using Prism.</param>
        public ModuleNavigator(IUnityContainer container, NavigationManager navigationManager)
        {
            this.container = container;
            this.navigationManager = navigationManager;

            //  UNITY
            //  1. When a class is resolving from Unity as System.Object types to get it to resolve to the correct
            //     type map Unity's native System.Object resolution to the correct type for the class requested.
            // 
            //  2. Include an instance of the ContainerControlledLifetimeManager class in the parameters
            //     to the RegisterType method to instruct the container to register a singleton mapping.
            container.RegisterType<object, ModulesNavigationView>(typeof(ModulesNavigationView).Name,
                new ContainerControlledLifetimeManager());

            navigationManager.NavigateNavigationRegion(typeof(ModulesNavigationView).Name);
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewContext"/> class.
 /// </summary>
 /// <param name="unityContainer">An instance of <see cref="IUnityContainer"/>.</param>
 /// <param name="modalManager">An instance of <see cref="ModalNavigator"/>.</param>
 /// <param name="navigationManager">An instance of <see cref="NavigationManager"/>.</param>
 /// <param name="logger">An instance of <see cref="ILoggerFacade"/>.</param>
 public ViewContext(IUnityContainer unityContainer, ModalNavigator modalManager, NavigationManager navigationManager, ILoggerFacade logger)
     : base(unityContainer, logger)
 {
     this.modalManager = modalManager;
     this.navigationManager = navigationManager;
 }