Beispiel #1
0
        public async Task ClearNavigationForPage(Type type)
        {
            CustomNavigationPage page = GetTabPageWithInitial(type);

            if (page != null)
            {
                await page.Navigation.PopToRootAsync(false);
            }
        }
Beispiel #2
0
        private CustomNavigationPage GetTabPageWithInitial(Type type)
        {
            CustomNavigationPage page = Children.OfType <CustomNavigationPage>()
                                        .FirstOrDefault(p =>
            {
                return(p.CurrentPage.Navigation.NavigationStack.Count > 0
                                                        ? p.CurrentPage.Navigation.NavigationStack[0].GetType() == type
                                                        : false);
            });

            return(page);
        }
Beispiel #3
0
        public bool TrySetCurrentPage(Type requiredPageType)
        {
            CustomNavigationPage page = GetTabPageWithInitial(requiredPageType);

            if (page != null)
            {
                CurrentPage = null;
                CurrentPage = page;
            }

            return(page != null);
        }
Beispiel #4
0
        public void AddPage(Page page, string title)
        {
            var navigationPage = new CustomNavigationPage(page)
            {
                Title = title,
                Icon  = GetIconForPage(page)
            };

            if (_previousPage == null)
            {
                _previousPage = page;
            }

            Children.Add(navigationPage);
        }