NavigationView on WinUI 3 is not aware of Window.ExtendsContentIntoTitleBar value and does not apply necessarily padding
See original GitHub issueDescribe the bug
NavigationView on WinUI 3 (Windows App SDK 1.0 Preview 2) is currently not aware of the Window.ExtendsContentIntoTitleBar value. If we extends the content into the titlebar, no padding would be added on the NavigationView and this basically steals the input from the titlebar once being extended in. Also, if the Setting button is enabled, this also render the 3 captive buttons (minimize, maximize/windowing, close) from being clicked.
Steps to reproduce the bug
- Create new WinUI 3 + .NET 5 project
- On MainWindow, add a
NavigationView
control as the root content and set thePaneDispayMode
to Top. - In MainWindow.xaml.cs, on the constructor, set
ExtendsContentIntoTitleBar
to true. - Build and run.
Expected behavior
The NavigationView control should have displayed their padding, but instead the control display no padding.
Screenshots
NuGet package version
No response
Windows app type
- UWP
- Win32
Device form factor
Desktop
Windows version
Insider Build (xxxxx)
Additional context
Observe on latest RTM Windows 11. 21H2 22000.194.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top Results From Across the Web
UWP: Navigation View does not fully extend into title bar
I've tried WinUI to use IsTitleBarAutoPaddingEnabled described in here. But doesn't work. App.xaml <Application x:Class="HelloWorld.App" ...
Read more >Window.ExtendsContentIntoTitleBar Property
Gets or sets a value that specifies whether the default title bar of the window should be hidden to create space for app...
Read more >NavigationView.IsTitleBarAutoPaddingEnabled Property
Gets or sets a value that indicates whether top padding is added to the navigation view's header when used with a custom title...
Read more >Microsoft release Windows UI Library 3 Preview 4
WinUI is a user interface layer that contains modern controls and styles for building Windows apps, both Desktop and UWP.
Read more >Untitled
ExtendsContentIntoTitleBar = true (you can use the WinUI 3 Gallery app as ... However, aligning NavigationView Back Button on the top left is...
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
@pratikone @karenbtlai What is the latest status on this issue?
there isn’t a dedicated inset value so one can use 42 px x 3 padding on the right edge for leaving space for titlebar. edit : on a second thought, the custom titlebar is a lower level api which draws custom min max close buttons in xaml and present it on the window. the controls should not be made aware of titlebar dimensions as it would change (dragging region, no caption button regions). Handling all that logic will unnecessarily increase complexity of navigation view and other controls.
As a result, I think NavigationView should not be handling this special case automatically. App developer can use padding as suggested earlier. so navigationView should not be aware of titlebar and caption buttons dimensions automatically.
I am working on an easy way for one to get the right inset automatically (which will not include the draggable region). Do reach out if you are facing issues in doing the padding and re-open the bug. I am closing it for now.