[Fix] NavigationView: Improve load & Fix ListView Size Initialization Issue#330
Open
Jack251970 wants to merge 6 commits intoiNKORE-NET:mainfrom
Open
[Fix] NavigationView: Improve load & Fix ListView Size Initialization Issue#330Jack251970 wants to merge 6 commits intoiNKORE-NET:mainfrom
Jack251970 wants to merge 6 commits intoiNKORE-NET:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a popup root exception that occurs when NavigationView is placed within a popup and makes changes to the IsPaneOpen property's default value. The main fix defers SplitView DisplayMode updates that occur during OnApplyTemplate to the OnLoaded event to prevent exceptions when NavigationView is in the popup root.
- Wraps the OnApplyTemplate logic in a try-finally block with a flag to track when the template is being applied
- Defers SplitView DisplayMode updates during OnApplyTemplate to the OnLoaded event to avoid popup root exceptions
- Removes the default value (true) from the IsPaneOpen dependency property, making it default to false
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| NavigationView.cs | Adds try-finally block around OnApplyTemplate, introduces flags to track template application state and defer SplitView DisplayMode updates to OnLoaded event |
| NavigationView.properties.cs | Removes explicit default value (true) from IsPaneOpenProperty metadata |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/NavigationView/NavigationView.cs
Outdated
Show resolved
Hide resolved
source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/NavigationView/NavigationView.cs
Outdated
Show resolved
Hide resolved
...e/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/NavigationView/NavigationView.properties.cs
Show resolved
Hide resolved
…onView/NavigationView.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Improve NavigationView load
Port from
microsoft-ui-xaml. Update visual state onOnLoadedevent to improve display effect.Fix ListView Size Initialization Issue
Set
NavigationView.IsPaneOpendefault to false to fix ListView size initialization issue ifNavigationViewdefaultDisplayModeisCompact.Test
Original:
After: