public void GetNavigationUriPath5()
        {
            var rootPage = new MasterDetailPage();

            rootPage.Master = new ContentPage()
            {
                Title = "Master"
            };

            var tabbedpage = new NavigationPathTabbedPageMock()
            {
                Title = "Page1"
            };

            var detail = new NavigationPage(tabbedpage);;

            rootPage.Detail = detail;

            var page1 = new NavigationPathPageMock()
            {
                Title = "Page1"
            };

            rootPage.Detail.Navigation.PushAsync(page1);

            var path = page1.ViewModel.NavigationService.GetNavigationUriPath();

            Assert.Equal("/MasterDetailPage/NavigationPage/TabbedPage1/Page1", path);

            path = tabbedpage.ViewModel.NavigationService.GetNavigationUriPath();
            Assert.Equal("/MasterDetailPage/NavigationPage/TabbedPage1", path);

            path = ((NavigationPathPageMock)tabbedpage.Children[0]).ViewModel.NavigationService.GetNavigationUriPath();
            Assert.Equal("/MasterDetailPage/NavigationPage/TabbedPage1?selectedTab=Page1", path);
        }
Example #2
0
        public async Task GetNavigationUriPath2()
        {
            var rootPage = new NavigationPage();

            var page1 = new NavigationPathTabbedPageMock()
            {
                Title = "TabbedPage1"
            };
            await rootPage.Navigation.PushAsync(page1);

            var path = ((NavigationPathPageMock2)page1.Children[1]).ViewModel.NavigationService.GetNavigationUriPath();

            Assert.Equal("/NavigationPage/TabbedPage1?selectedTab=Page2", path);
        }