Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crashes when using NavigationView that contains only one NavigationViewItem. #10265

Open
ynkdir opened this issue Jan 2, 2025 · 1 comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@ynkdir
Copy link

ynkdir commented Jan 2, 2025

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.

    <AppxPackage>false</AppxPackage>
    <WindowsPackageType>None</WindowsPackageType>
  1. Edit MainWindow.xaml
<?xml version="1.0" encoding="utf-8"?>
<Window
    x:Class="navviewtest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:navviewtest"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Title="navviewtest">

    <NavigationView>
        <NavigationView.MenuItems>
            <NavigationViewItem Content="Item1" />
            <!--
            App doesn't crash when there are two items.
            <NavigationViewItem Content="Item2" />
            -->
        </NavigationView.MenuItems>
    </NavigationView>

</Window>
  1. Edit MainWindow.cpp to disable template code.
    void MainWindow::myButton_Click(IInspectable const&, RoutedEventArgs const&)
    {
        //myButton().Content(box_value(L"Clicked"));
    }
  1. Build and Run. Then make window smaller with mouse.

Expected behavior

No response

Screenshots

Image

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

@ynkdir ynkdir added the bug Something isn't working label Jan 2, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

1 participant