Ejemplo n.º 1
0
        /// <inheritdoc/>
        public void Navigate(Navigation navigateTo)
        {
            CleanupCurrentController();

            Navigation redirectedFrom = null;

            CurrentNavigation = navigateTo;
            CurrentController = Ioc.CreateWithKey <IController>(CurrentNavigation.ControllerId);

            // Check if a redirection is necessary
            if (CurrentController.NeedsNavigationRedirect(CurrentNavigation, out Navigation redirectTo))
            {
                redirectedFrom    = CurrentNavigation;
                CurrentNavigation = redirectTo;
                CurrentController = Ioc.CreateWithKey <IController>(CurrentNavigation.ControllerId);
            }
            CurrentController.ShowInView(_htmlView, CurrentNavigation.Variables, redirectedFrom);
        }