Win32 Xaml Island load component from library #312
-
There is a sample for WinUI 2 for doing it here and a how to here. Is there a way to do it with WindowsAppSDK? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It mostly works the same way. |
Beta Was this translation helpful? Give feedback.
It mostly works the same way.
The biggest differences are that you need to create a dispatcher queue (Microsoft.UI.Dispatching.DispatcherQueue via Microsoft.UI.Dispatching.DispatcherQueueController) on the thread which has the message pump first.
The islands use the window id (Microsoft.UI.WindowId) instead of the interop interfaces. This means that to initialise the DesktopWindowXamlSource instance, you would first use the GetWindowIdFromWindow function (C++) or Win32Interop.GetWindowIdFromWindow static method (C#) and then call DesktopWindowXamlSource.Initialize using this WindowId, instead of obtaining the IDesktopWindowXamlSourceNative interface. This interface no longer exists in the…