WinUI 2.4.0-prerelease.200113001 breaks NavigationViewHeaderBehavior
Describe the bug
The latest 2.4 preview has moved NavigationView from using ListView to ItemRepeater. There seems to be a change in behaviour on how the NavigationView.Header behaves. Setting NavigationViewHeaderBehavior.HeaderMode="Never" seems to have no impact anymore and when window is narrow most mode, Header is made visible.
My understanding is that setting NavigationView.Header = null use to hides the Header and now in latest release it does not hide it anymore, I maybe wrong, hence the ticket before maybe asking winui team for a change or finding an alternative.
<Page
x:Class="App1.Views.MainPage"
xmlns:behaviors="using:App1.Behaviors"
behaviors:NavigationViewHeaderBehavior.HeaderMode="Never">
Expected behavior
Hide Header if mode is set to Never.
Additional context 2.4.0-prerelease.200113001
System
- VS Version: 2019, 16.4
- WinTS Wizard Version:
- WinTS Template Version:
- Windows Build: 1803
@harvinders, thanks for reporting! We'll look at the changes and see how to adapt the NavigationViewHeaderBehavior
I've tried to reproduce it on VS2019 16.4.3 and Windows 10 1903 creating an MVVM Basic App, the header mode works as expected on Always, minimal and never mode. Can you give more info about the framework you are using or adding an app that reproduces the bug?
I am using a VS2019 16.4.0 on 1803 with 1903 as Target and 1803 as min target. I will try to create a min repo for your reference.
You are right @mvegaca , I could not reproduce it either with a min repo. Another thing that I have is my app extends the app into the titlebar. Let me check if that could be the reason, or if my WTS code base is too old.
@mvegaca After a closer look, I think the issue is still there. Here are the screen shot of App with a Page using setting of HeaderMode = Never in two versions of WinUI library
WinUI - 2.4.0-prerelease.191217001 . . . . . . . . . . . . . . . . . . . . WinUI - 2.4.0-prerelease.200113001

As you can see the page is extended to take the space occupied by header in previous version, but that is not the case in newer version of WinUI.
The repo can be found here. When app is started it displays MainPage, clicking on any Item on the page takes user to SecondPage. This page has setting of HeaderMode = Never.
You can change the WinUI version and see the effect.
Is this still an issue?
Yes @sibille, I have raised it with WinUI team here. The lead developer @ranjeshj could not reproduce it, but I am able to reproduce it easily with the repo present here.
ok, awesome! Thanks for reaching out to the WinUI team! I was not able to reproduce neither (on 1909),