microsoft-ui-xaml
microsoft-ui-xaml copied to clipboard
NavigationView regression on WinUI 2.8
Describe the bug
A NavigationViewItem with its MenuItems filled with one or more NavigationViewItem, failed to draw the content of MenuItems when using WinUI 2.8.
This is a regression, as such scenario was working perfectly fine with prior version of WinUI.
Steps to reproduce the bug
Create a UWP project with WinUI 2.8 with the following:
.xaml:
<muxc:NavigationView Loaded="NavView_Loaded">
<muxc:NavigationView.MenuItems>
<muxc:NavigationViewItem x:Name="items" Content="Items" IsExpanded="True" />
</muxc:NavigationView.MenuItems>
</muxc:NavigationView>
.xaml.cs:
private Mux.NavigationViewItem CreateMenuItem(string title)
=> new Mux.NavigationViewItem
{
Content = title,
};
private void NavView_Loaded(object sender, RoutedEventArgs e)
=> items.MenuItems.Add(CreateMenuItem("Item 0"));
Expected behavior
The NavigationViewItem which is part of a NavigationViewItem.MenuItems is expected to be drawn as it was the case with previous WinUI version.
Screenshots
WinUI 2.8:
Note that Item 0 is not visible whereas MenuItems contains the expected elements.
WinUI 2.7.2:
Note that Item 0 is visible as expected.
NuGet package version
Microsoft.UI.Xaml 2.8.0
Windows app type
- [ ] UWP
- [ ] Win32
Device form factor
Desktop
Windows version
Windows 11 (21H2): Build 22000
Additional context
No response
@ranjeshj FYI
Another note on this bug, after adding subitem to the NavigationViewItem, the app crash if the panel is manually or automatically compacted.
