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

Cannot use multiple Windows in WinUI 3 1.0.0 Preview #5918

Closed
MrDeej opened this issue Sep 19, 2021 · 8 comments
Closed

Cannot use multiple Windows in WinUI 3 1.0.0 Preview #5918

MrDeej opened this issue Sep 19, 2021 · 8 comments
Labels
product-winui3 WinUI 3 issues team-Reach Issue for the Reach team v1.0.0-preview1

Comments

@MrDeej
Copy link

MrDeej commented Sep 19, 2021

Describe the bug
When I try to create a new Window other than the MainWindow, it throws an Exception from KernelBase.

When I try to create a new AppWindow, I cannot find a way to set a content.

The AppWindow shows fine, but without content.

In UWP we used ElementCompositionPreview.SetAppWindowContent(appWindow, new Page()); but this does not exist in WinUI 3.
In WinUI 3 Experimental we first created the new Window(), then got the AppWindow from the Windows Handle and Window ID.

Steps to reproduce the bug

  1. Create a new WinUI 3 1.0.0 Preview Desktop app
  2. Create methods from screenshots
  3. Not able to use multiple windows with my app

Expected behavior
Desktop app should be able to use multiple windows. Also the Window.Activate() worked fine in WinUI 3 1.0.0 Experimental for multiple Windows on same thread.

Screenshots
image
image

Version Info
WinUI 3 1.0.0 Preview Desktop, Windows 10 19044, Visual Studio 2019 16.11.2

NuGet package version:
image
Windows app type: Win32 x86

| Windows version
| Insider Build (19044)

| Device form factor | Saw the problem?
| Desktop

Additional context
Need this as fast as possible.

Our current UWP app have grown so large that RH-Bind goes out of memory even in x64 compiler, and currently unable to build. Also our current UWP app is using gRPC.Core wich have production bugs that are solved when using WinUI and Net 5.

This is a large LOB app.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Sep 19, 2021
@codendone
Copy link
Contributor

Unfortunately the support for multiple Windows was not finished in time to be included in 1.0. The Experimental build had the block for this and other incomplete features disabled, and those blocks are re-enabled for Preview and Stable releases.

@MrDeej
Copy link
Author

MrDeej commented Sep 22, 2021

Ohh, thank you for the answer.

It still looks like WinUI 3 1.0.0.0 Experimental is more stable than our current UWP build, so I think we will have to go to production with this. But please disable the block in next WinUI 3 Preview. It works perfectly fine for our needs in the Experimental build, with only 1 workaround for activating the window (it displays newwindow behind the mainwindow when newwindow is heavily loaded with ui objects).

@akilarajesh1313 akilarajesh1313 added fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. needs-triage Issue needs to be triaged by the area owners and removed needs-triage Issue needs to be triaged by the area owners labels Sep 22, 2021
@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Sep 22, 2021
@codendone codendone removed the fixed-internally This bug has been fixed, and the fix will be shipped in the next version of WinUI 3. label Sep 24, 2021
@bpulliam bpulliam added the team-Reach Issue for the Reach team label Oct 13, 2021
@Sacwith
Copy link

Sacwith commented Nov 26, 2021

how to create Window on Window in winui3 with wpf preview 1.0?

@nkasco
Copy link

nkasco commented Mar 15, 2022

Any workarounds for this?

@codendone
Copy link
Contributor

Multiple Windows on the same thread is now supported in Windows App SDK 1.0.1. Check out the release notes for more info.

@dotMorten
Copy link
Contributor

dotMorten commented Apr 4, 2022

@codendone I'm still seeing this happening on my Windows 10 PC (18363). Exact same code works on my Windows 11 PC. Both 1.0.1 and 1.1.0-preview1 has this behavior.

image

The release notes didn't mention anything about it being a Win11-only thing.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Apr 4, 2022
@codendone
Copy link
Contributor

@dotMorten I think you logged microsoft/WindowsAppSDK#2363 for what you were hitting?

@ghost ghost removed the needs-triage Issue needs to be triaged by the area owners label Apr 6, 2022
@dotMorten
Copy link
Contributor

dotMorten commented Apr 6, 2022

Yeah it was due to another bug in the app Sdk packaging system that led to that behavior. It’s a deployment issue of mixed versions that was causing it: ignore my comment above

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Apr 6, 2022
@krschau krschau added servicing-1.0.1 and removed needs-triage Issue needs to be triaged by the area owners servicing-consider-1.0 labels Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-winui3 WinUI 3 issues team-Reach Issue for the Reach team v1.0.0-preview1
Projects
None yet
Development

No branches or pull requests

10 participants