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

NavigationView inside ContentDialog causes crash in WinUI3 Desktop #2713

Closed
eleanorleffler opened this issue Jun 19, 2020 · 4 comments · Fixed by #2920
Closed

NavigationView inside ContentDialog causes crash in WinUI3 Desktop #2713

eleanorleffler opened this issue Jun 19, 2020 · 4 comments · Fixed by #2920
Labels
appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps area-Dialogs area-NavigationView NavView control product-winui3 WinUI 3 issues team-Controls Issue for the Controls team

Comments

@eleanorleffler
Copy link

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

  1. Clone the WinUI3 Problems DialogWithNavView repository.
  2. Go to the DialogWithNavViewWinUI folder.
  3. Open the DialogWithNavViewWinUI solution in Visual Studio 2019 Preview.
  4. Build and run with Debug x64.
  5. Click the "Click me" button.
  6. You should see that the ContentDialog does not appear, and the application crashes with an error. See Screenshot#1.

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

DialogWithNavViewErrorMessage

Screenshot#1 - Current Behavior (Error Message)

DialogWithNavViewExpectedBehavior

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.

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jun 19, 2020
@eleanorleffler eleanorleffler changed the title NavigationView inside ContentDialog causes crash NavigationView inside ContentDialog causes crash in WinUI3 Desktop Jun 19, 2020
@StephenLPeters
Copy link
Contributor

I'm curious why you are putting a NavView in a Content Dialog :) seems like a valid bug but a strange use case.

@StephenLPeters StephenLPeters added area-Dialogs area-NavigationView NavView control appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps team-Controls Issue for the Controls team product-winui3 WinUI 3 issues and removed needs-triage Issue needs to be triaged by the area owners labels Jun 22, 2020
@eleanorleffler
Copy link
Author

Hi @StephenLPeters ! We host our settings interface inside of the NavView inside the ContentDialog.

@ojhad
Copy link
Contributor

ojhad commented Jul 10, 2020

@eleanorleffler Can you try setting IsPaneOpen="False" on the NavigationView as a workaround? That hopefully should unblock you for now

@eleanorleffler
Copy link
Author

@ojhad The workaround unblocks us! Thank you for the workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps area-Dialogs area-NavigationView NavView control product-winui3 WinUI 3 issues team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants