You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes an issue where setting the IsPaneOpen property of the NavigationView to false before launching the NavigationView in the Left expanded state (either explicitly or via the Auto pane display mode) would have no effect (the pane is launched in an open state).
The updated behavior of the NavigationView.IsPaneOpen API is the following on NavigationView launch:
PaneDisplayMode
IsPaneOpen value
Pane will be opened
Remarks
Auto
True
❓
If NavigationView is set into LeftMinimal/LeftCompact mode the pane will be launched in a closed state and IsPaneOpen will be set to false. If the NavigationView is set into Left mode the pane will be launched in an opened state
LeftMinimal
True
❌
IsPaneOpen will be set to false
LeftCompact
True
❌
IsPaneOpen will be set to false
Left
True
✔
-
Top
True
-
No pane to open
Auto
False
❌
Pane will be launched in a closed state for every app window width (*)
LeftMinimal
False
❌
-
LeftCompact
False
❌
-
Left
False
❌
(*)
Top
False
-
No pane to open
(*) = This behavior has been updated as part of this PR. The pane is now closed when IsPaneOpen is set to false and the pane is launched in Left expanded state (either explicitly or via the Auto display mode). All other configurations you see in the table above are the current behavior and unchanged by this PR.
Once this PR has been merged we should also consider providing this information about the PaneDisplayMode and IsPaneOpen API interplay on NavigationView launch on the NavigationView.IsPaneOpen API documentation page (for example in a "Remarks" section) starting with whatever WinUI version will include this change.
I'd like @ojhad to weigh in, we had a conversation about this behavior during a debug session a few weeks ago. Do you remember the context of that conversation?
I'd like @ojhad to weigh in, we had a conversation about this behavior during a debug session a few weeks ago. Do you remember the context of that conversation?
If I remember correctly, we were launching into compact mode and that the pane was being forced into the closed state regardless of the IsPaneOpen property (which, according to above, seems like the intended behavior).
However changing the IsPaneOpen property was causing different codepaths to get taken (hence the content dialog issue). When it was set to true, during setup, that value propagated to splitview which caused it to try add children to the popup root during measure.
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
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 PR fixes an issue where setting the
IsPaneOpenproperty of the NavigationView to false before launching the NavigationView in the Left expanded state (either explicitly or via theAutopane display mode) would have no effect (the pane is launched in an open state).The updated behavior of the NavigationView.IsPaneOpen API is the following on NavigationView launch:
(*) = This behavior has been updated as part of this PR. The pane is now closed when
IsPaneOpenis set to false and the pane is launched in Left expanded state (either explicitly or via theAutodisplay mode). All other configurations you see in the table above are the current behavior and unchanged by this PR.Once this PR has been merged we should also consider providing this information about the PaneDisplayMode and IsPaneOpen API interplay on NavigationView launch on the NavigationView.IsPaneOpen API documentation page (for example in a "Remarks" section) starting with whatever WinUI version will include this change.
Motivation and Context
Fixes #2391.
How Has This Been Tested?
Tested manually and added an API test.
Additional Context
@YuliKl FYI.