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.

NavigationView on WinUI 3 is not aware of Window.ExtendsContentIntoTitleBar value and does not apply necessarily padding

See original GitHub issue

Describe 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

  1. Create new WinUI 3 + .NET 5 project
  2. On MainWindow, add a NavigationView control as the root content and set the PaneDispayMode to Top.
  3. In MainWindow.xaml.cs, on the constructor, set ExtendsContentIntoTitleBar to true.
  4. Build and run.

Expected behavior

The NavigationView control should have displayed their padding, but instead the control display no padding.

Screenshots

image

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

github_iconTop GitHub Comments

2reactions
gabbybilkacommented, Jun 13, 2022

@pratikone @karenbtlai What is the latest status on this issue?

0reactions
pratikonecommented, Nov 16, 2022

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.

Read more comments on GitHub >

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

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