Exemple #1
0
        public async Task EnsureOnAppearingFiresForPushedPage()
        {
            Shell shell = new TestShell();

            shell.Items.Add(CreateShellItem());
            shell.Navigation.PushAsync(new LifeCyclePage());
            var page = (LifeCyclePage)shell.GetVisiblePage();

            Assert.IsTrue(page.Appearing);
            Assert.IsTrue(page.ParentSet);
        }
Exemple #2
0
        public async Task EnsureOnAppearingFiresForNavigatedToPage()
        {
            Shell shell = new TestShell();

            shell.Items.Add(CreateShellItem());
            await shell.GoToAsync("LifeCyclePage");

            var page = (LifeCyclePage)shell.GetVisiblePage();

            Assert.IsTrue(page.Appearing);
            Assert.IsTrue(page.ParentSet);
        }
Exemple #3
0
        public async Task EnsureOnAppearingFiresForLastPageOnly()
        {
            Shell         shell            = new TestShell();
            LifeCyclePage shellContentPage = new LifeCyclePage();

            shell.Items.Add(CreateShellItem(page: shellContentPage));
            await shell.GoToAsync("LifeCyclePage/LifeCyclePage");

            var page           = (LifeCyclePage)shell.GetVisiblePage();
            var nonVisiblePage = (LifeCyclePage)shell.Navigation.NavigationStack[1];

            Assert.IsFalse(nonVisiblePage.Appearing);
            Assert.IsTrue(page.Appearing);
        }