fix(Gallery): Fix navigation state mismatch and lost selection on search results page#425
Open
PrefacedCorg wants to merge 2 commits into
Open
fix(Gallery): Fix navigation state mismatch and lost selection on search results page#425PrefacedCorg wants to merge 2 commits into
PrefacedCorg wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request fixes core navigation state anomalies in the Gallery sample project, improves the robustness of the navigation logic, and syncs the latest code from the upstream main branch, with no breaking changes introduced.
Key Fixes & Improvements
OnRootFrameNavigatedmethod, replacing independentifbranches with a sequential, mutually exclusiveif-else ifstructure. This prevents duplicate branch execution and repeated value assignment that could lead to state conflicts during a single navigation operation.SearchResultsPageto properly record the page type to_lastItem, resolving the bug where the NavigationView selected item is lost or mismatched when navigating to/from the search results page via forward/backward operations.SettingsPagevalidation branch to the front of the logic flow, prioritizing handling for special pages without corresponding navigation menu items, and preventing state from being incorrectly overwritten by subsequent branches.iNKORE-NET:mainbranch to resolve branch differences and ensure this PR can be merged without conflicts.Impact Scope
Only modifies the navigation root page code of the
iNKORE.UI.WPF.Modern.Gallerysample project. No changes to the core library source code, no API alterations, and no breaking changes.Validation & Testing