question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Fully disabling the Compact mode of NavigationView

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
MartinZikmundcommented, Feb 5, 2021

@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 the NavigationView and then toggle IsPaneVisible instead of IsPaneOpen. But it would be nice if the control supported this out of the box somehow. I have a feeling it was possible with the Windows.UI.Xaml.Controls.NavigationView although I didn’t test it now.

1reaction
chingucodingcommented, Feb 5, 2021

Do VisualStyleSetters still have breakpoints as the window resizes, even with the ToggleButton not visible @chingucoding ?

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).

@chingucoding This is possible, but that prevents the user from making the content “full screen” which I would like to support. What I want is similar to LeftMinimal but with the difference that in open state the pane would be “inline”, not overlay

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found