-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix destory older pages when navigation from NavigationPage #1067
Fix destory older pages when navigation from NavigationPage #1067
Conversation
…-call-destory-when-poptorootasync
I was wrong. |
|
||
await DoNavigateAction(currentNavRoot, nextSegment, newRoot, parameters, async () => | ||
var replaseRoot = currentNavRoot.GetType() != nextPageType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
misspelling: replaceRoot
await ProcessNavigation(rootPage, segments, parameters, false, animated); | ||
await DoNavigateAction(currentNavRoot, nextSegment, rootPage, parameters, async () => | ||
{ | ||
if (replaseRoot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not handling the scenario of when clearNavStack is false pages are pushed onto the stack. Right now, that scenario is broken. I should probably have a test for that :)
Thanks for the review. |
Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there. It's looking good. Just one more scenario :)
{ | ||
var fromPage = currentPage.Navigation.NavigationStack.Last(); | ||
var nextPage = CreatePageFromSegment(nextSegment); | ||
await ProcessNavigation(nextPage, segments, parameters, false, animated); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now when ClearNavigationStackOnNavigation is false and the current page is the same as the page being navigated to, you get a duplicate page. You need to also check to make sure the target page is not the same type as the current page. Similar to line 223
I understand and fixed it! |
…when-poptorootasync
…when-poptorootasync
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Please take a moment to fill out the following:
Fixes issue #1045 .
Changes proposed in this pull request:
When there are multiple pages in Navigation Stack, when navigation from NavigationPage, Destroy of removed page from Stack is not called.
Fixed this problem.
It is redoing of this PR #1051 .