Question: Fully disabling the Compact mode of NavigationView
See original GitHub issueIs it possible to completely disable the NavigationView’s Compact display mode? When I set the NavigationView PaneDisplayMode
to Left
, tapping the toggle button turns the pane into compact mode, instead of completely collapsing it.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
c# - UWP - Prevent NavigationViewItemHeader from being ...
Disable compact and expanded display mode of the NavigationView by setting the CompactModeThresholdWidth and ExpandedModeThresholdWidth to ...
Read more >NavigationView Class (Windows.UI.Xaml.Controls)
Represents a container that enables navigation of app content. It has a header, a view for the main content, and a menu pane...
Read more >NavigationView.CompactModeThresholdWidth Property
Gets or sets the minimum window width at which the NavigationView enters Compact display mode. Equivalent WinUI 2 API for UWP: Microsoft.UI.Xaml.Controls.
Read more >The Complete Guide to NavigationView in SwiftUI
In this article I want to demonstrate the full range of ways you can ... By attaching the title to whatever is inside...
Read more >Changing a view's layout in response to size classes
Changing a view's layout in response to size classes ... Most iPhones in landscape have compact width and compact height.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mdtauk I would prefer to keep the
NavigationView
as it really has a lot of features out of the box. So far the solution that sounds doable would be to hide the toggle button, add my own above theNavigationView
and then toggleIsPaneVisible
instead ofIsPaneOpen
. But it would be nice if the control supported this out of the box somehow. I have a feeling it was possible with theWindows.UI.Xaml.Controls.NavigationView
although I didn’t test it now.If you are using auto, yes NavigationView would still listen to that, the logic ignores whether there is a splitbutton or not from what it looks like. Btw, the “Auto” behavior is actually done in code behind (as we are not listening to window size but rather the NavigationViews size).
I’m afraid there is no such option right now. As @mdtauk suggested, SplitView is a good alternative in that case. Another way would be to retemplate and have the “compact” state collapse completely instead of being a narrow strip. I would probably try to go for the retemplate approach unless you only need a very basic navigation that would be easy to do (few buttons, no settings or search etc).