Ejemplo n.º 1
0
        private static Page ProcessCurrentPageNavigationPath(Page page, Stack <string> stack)
        {
            var    currentPageKeyInfo = PageNavigationRegistry.GetPageNavigationInfo(page.GetType());
            string currentSegment     = $"{currentPageKeyInfo.Name}";

            var parent = page.Parent as Page;

            if (parent != null)
            {
                var parentKeyInfo = PageNavigationRegistry.GetPageNavigationInfo(parent.GetType());

                if (parent is TabbedPage || parent is CarouselPage)
                {
                    //set the selected tab to the current page
                    currentSegment = $"{parentKeyInfo.Name}?{KnownNavigationParameters.SelectedTab}={currentPageKeyInfo.Name}";
                    page           = parent;
                }
                else if (parent is MasterDetailPage)
                {
                    currentSegment = $"{parentKeyInfo.Name}/{currentPageKeyInfo.Name}";
                    page           = parent;
                }
            }

            stack.Push(currentSegment);

            return(page);
        }
Ejemplo n.º 2
0
        private static void AddSegmentToStack(Page page, Stack <string> stack)
        {
            if (page == null)
            {
                return;
            }

            var keyInfo = PageNavigationRegistry.GetPageNavigationInfo(page.GetType());

            if (keyInfo != null)
            {
                stack.Push(keyInfo.Name);
            }
        }