microsoft / microsoft/microsoft-ui-xaml
Application crashes when using NavigationView that contains only one NavigationViewItem.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
Application crashes when using NavigationView that contains only one NavigationViewItem.
### Steps to reproduce the bug
1. Create new c++ desktop winui3 project.
2. Edit .vcxproj file to build unpackaged app.
```
false
None
```
3. Edit MainWindow.xaml
```xml
```
4. Edit MainWindow.cpp to disable template code.
```cpp
void MainWindow::myButton_Click(IInspectable const&, RoutedEventArgs const&)
{
//myButton().Content(box_value(L"Clicked"));
}
```
5. Build and Run. Then make window smaller with mouse.
### Expected behavior
_No response_
### Screenshots

### NuGet package version
WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003
### Windows version
Windows 11 (24H2): Build 26100
### Additional context
_No response_
Contributor guide
Research direction
Start with the minimal MainWindow.xaml containing one NavigationViewItem, the unpackaged settings in the .vcxproj file, and MainWindow.cpp; build and run the C++ desktop WinUI 3 app, then resize the window. Trace the NavigationView behavior during resizing and compare it with the two-item case. Done means the one-item NavigationView no longer crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100