Describe the bug
The NavigationView inside the ContentDialog causes the application to crash.
We have the NavigationView inside the ContentDialog working in UWP.
When moved over to WinUI3 Desktop, the application crashes before the NavigationView can load.
Steps to reproduce the bug
Expected behavior
After clicking on the "Click me" button, we expect to see the NavigationView inside the ContentDialog. See Screenshot#2 below for expected behavior.
We expect to see the same behavior we saw in UWP. Build and run the DialogWithNavViewUWP solution inside the DialogWithNavViewUWP folder to see expected behavior.
Screenshots
Screenshot#1 - Current Behavior (Error Message)
Screenshot#2 - Expected Behavior
Version Info
NuGet package version:
[Microsoft.VCRTForwarders.140 1.0.6]
[Microsoft.WinUI 3.0.0-preview1.200515.3]
Targeting:
Target: Universal Windows
Target version: Windows 10, version 1809 (10.0; Build 17763)
Min version: Windows 10, version 1809 (10.0; Build 17763)
| Windows 10 version | Saw the problem? |
| :--------------------------------- | :-------------------- |
| Insider Build (xxxxx) | |
| November 2019 Update (18363) | |
| May 2019 Update (18362) | |
| October 2018 Update (17763) | Yes |
| April 2018 Update (17134) | |
| Fall Creators Update (16299) | |
| Creators Update (15063) | |
| Device form factor | Saw the problem? |
| :-------------------- | :------------------- |
| Desktop | Yes |
| Mobile | |
| Xbox | |
| Surface Hub | |
| IoT | |
Additional context
If the NavigationView is removed or commented out, the application does not crash and the ContentDialog is displayed (without NavigationView).
To demonstrate this, comment out line numbers 16 - 22 in DialogWithNavView.xaml.
I'm curious why you are putting a NavView in a Content Dialog :) seems like a valid bug but a strange use case.
Hi @StephenLPeters ! We host our settings interface inside of the NavView inside the ContentDialog.
@eleanorleffler Can you try setting IsPaneOpen="False"
on the NavigationView as a workaround? That hopefully should unblock you for now
@ojhad The workaround unblocks us! Thank you for the workaround!
Most helpful comment
I'm curious why you are putting a NavView in a Content Dialog :) seems like a valid bug but a strange use case.