Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional logging for PopLifeCycle #23103

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public async Task PushLifeCycle(bool useMaui)
[InlineData(true)]
public async Task PopLifeCycle(bool useMaui)
{
bool appearingShouldFireOnInitialPage = false;
ContentPage initialPage = new ContentPage();
ContentPage pushedPage = new ContentPage();

Expand All @@ -82,14 +83,18 @@ void OnInitialPageAppearing(object sender, EventArgs e)
_ = new TestWindow(nav);

await waitForFirstAppearing.Task;
initialPage.Appearing += (sender, _)
=> rootPageFiresAppearingAfterPop = (ContentPage)sender;
initialPage.Appearing += (sender, _) =>
{
Assert.True(appearingShouldFireOnInitialPage);
rootPageFiresAppearingAfterPop = (ContentPage)sender;
};

pushedPage.Disappearing += (sender, _)
=> pageDisappeared = (ContentPage)sender;

await nav.PushAsync(pushedPage);
Assert.Null(rootPageFiresAppearingAfterPop);
appearingShouldFireOnInitialPage = true;
Assert.Null(pageDisappeared);

await nav.PopAsync();
Expand Down
Loading