Skip to content

[Fix] NavigationView: Improve load & Fix ListView Size Initialization Issue#330

Open
Jack251970 wants to merge 6 commits intoiNKORE-NET:mainfrom
Jack251970:navigation_view_load
Open

[Fix] NavigationView: Improve load & Fix ListView Size Initialization Issue#330
Jack251970 wants to merge 6 commits intoiNKORE-NET:mainfrom
Jack251970:navigation_view_load

Conversation

@Jack251970
Copy link
Contributor

Improve NavigationView load

Port from microsoft-ui-xaml. Update visual state on OnLoaded event to improve display effect.

Fix ListView Size Initialization Issue

Set NavigationView.IsPaneOpen default to false to fix ListView size initialization issue if NavigationView default DisplayMode is Compact.

Test

Original:

Screenshot 2025-08-08 205447

After:

Screenshot 2025-08-09 092933

@Jack251970 Jack251970 changed the title Improve NavigationView load & Fix ListView Size Initialization Issue NavigationView: Improve load & Fix ListView Size Initialization Issue Aug 28, 2025
@Jack251970 Jack251970 changed the title NavigationView: Improve load & Fix ListView Size Initialization Issue [Fix] NavigationView: Improve load & Fix ListView Size Initialization Issue Aug 29, 2025
@NotYoojun NotYoojun requested a review from Copilot October 31, 2025 16:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

NotYoojun and others added 2 commits November 1, 2025 00:29
…onView/NavigationView.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants