0

Or is there a way to cast them to winrt::Microsoft::UI::Xaml::Window?

If not, does that mean I have to do the following things with the help of some custom classes applied to manage extra windows?

https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/system-backdrop-controller

So far, I'm able to invoke a new window through declaring Window object and setting the content from a XAML. But it's sort of inconvenient and limited for my part.

Ax1le
  • 6,563
  • 2
  • 14
  • 61
ACGMN
  • 9
  • 3
  • What doesn't work if you change `runtimeclass MyOtherWindow : Microsoft.UI.Xaml.Controls.Page` to `runtimeclass MyOtherWindow : Microsoft.UI.Xaml.Window` in `MyOtherWindow.idl`? – Simon Mourier May 08 '23 at 09:18
  • @SimonMourier Thanks, guy. I haven't expected that BlankWindow generated by VS would have a runtime class of Page instead of Window. That's quite illogical. – ACGMN May 08 '23 at 13:57
  • It's because with UWP (which most WinUI3 source code is based on), you only had one window. With WinUI3 you can have multiple ones (which is why Window.Current is always null https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.window.corewindow?view=windows-app-sdk-1.3) – Simon Mourier May 09 '23 at 06:43

0 Answers0