Get Back to the Xaml Window from AppWindow #3463
Replies: 5 comments 14 replies
-
Whenever I use AppWindow, I normally use it like:
Excuse the C++. |
Beta Was this translation helpful? Give feedback.
-
If we start from a Microsoft.UI.Windowing.AppWindow, we can get the handle of the corresponding Win32 window from the AppWindow.Id as follows: IntPtr hWnd = Win32Interop.GetWindowFromWindowId(appWindow.Id); However, I can find no way to get back the corresponding Microsoft.UI.Xaml.Window from Win32 handle (hWnd). Can anyone else? Of course, you can store a copy ... but that's not the question. |
Beta Was this translation helpful? Give feedback.
-
In 1.3 experimental you can now directly access AppWindow from the MainWindow. |
Beta Was this translation helpful? Give feedback.
-
We do have this static method of the Xaml Window:
However, I get errors when attempting to call this method. |
Beta Was this translation helpful? Give feedback.
-
I would revamp this topic for the following reason: I want to create a modal Window, just like the Options Window in our loved Visual Studio. This seems not possible with Winui3, unless using low-level APIs. (please correct me if I'm wrong). So I would try to create a modal Windows in the following way:
And an empty modal windows is shown. But how can I populate the window? I need the So, I can get the "Window" pointer:
But I still cannot get the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This code gets you to the AppWindow from a Xaml Window:
Beta Was this translation helpful? Give feedback.
All reactions