question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to open a new Window in WinUI 3 for Desktop

See original GitHub issue

I have a xaml file that has a Window inside

<Window
    x:Class="MyProject.MyWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Grid>
        <!-- The content of the window -->
    </Grid>
</Window>

In previous versions, don’t remember which, I was opening the window with the following code

var form = new MyWindow();
form.Activate();

but it is not working anymore. How should I open a window?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
tinmaccommented, Dec 5, 2021

@marb2000 Is there an issue/discussion I can track to keep up to date with multiple window support? Thanks.

8reactions
float34commented, Jun 5, 2021

Window in Windows can’t create a new window, that’s what one should expect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show multiple views with AppWindow
Show a new window · Call the static AppWindow.TryCreateAsync method to create a new AppWindow. · Create the window content. Typically, you create...
Read more >
How do I open a new Window in WinUI3 with WinRT/C++?
Frame.Navigate(xaml_typename<NewWindowClass>()) · winrt::Microsoft::UI::Xaml::Controls::Frame rootFrame{ nullptr }; auto content = Window:: ...
Read more >
Multi-Windowing in WinUI 3 | XAML Brewer, by Diederik Krols
Opening extra windows. To open a new window, just instantiate one and call Activate(). Here's the core code behind our launch button: ...
Read more >
How to freeze main window when new window is opened ...
Currently, when I open a new window using Window.Activate() both main window and the window I just activated are enabled.
Read more >
Build your first WinUI 3 app (Part 1) - Windows Developer Blog
This 3-part blog aims to help members new to Windows development quickly build familiarity using the Window App SDK through a fun sample...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found