示例#1
0
        /// <summary>
        ///     Navigates to the supplied context parameterized by the supplied data parameter and clears the navigation stack.
        /// </summary>
        /// <param name="homeNavigationContextName">Exported name of Navigation context to navigate to</param>
        /// <param name="parameter">Uri to the initialization data.</param>
        public void NavigateToHome(string homeNavigationContextName, Uri parameter)
        {
            navigationStack.Clear();

            INavigableContext navContext = GetNavigableContext(homeNavigationContextName);

            navContext.Initialize(parameter);
            CurrentNavigationContext = navContext;
        }
示例#2
0
        /// <summary>
        ///     Navigates to the supplied context parameterized by the supplied data parameter and pushes the current context onto the navigation stack.
        /// </summary>
        /// <param name="navigationContextName">Exported name of Navigation context to navigate to</param>
        /// <param name="parameter">Uri to the initialization data.</param>
        public void NavigateTo(string navigationContextName, Uri parameter)
        {
            if (null == navigationContextName)
            {
                throw new ArgumentNullException("navigationContextName");
            }

            if (null != CurrentNavigationContext)
            {
                navigationStack.Push(CurrentNavigationContext);
            }

            INavigableContext navContext = GetNavigableContext(navigationContextName);

            navContext.Initialize(parameter);
            CurrentNavigationContext = navContext;
        }