-
Notifications
You must be signed in to change notification settings - Fork 288
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
Feature request: Allow win2d.uwp and win2d.winui to co-exist #957
Comments
Using win2d.uwp and win2d.winui in the same app is not supported right now. This is mostly because combining WinUI3 and UWP XAML in one process is not supported. Both WinUI3 and UWP Xaml use the namespace/binary/winmd name Microsoft.UI.Xaml, which would conflict with one another. Win2d.uwp depends on UWP Microsoft.UI.Xaml and win2d.winui depends on WinUI3 Microsoft.UI.Xaml, so you cannot have both in the same process right now. In the future, we might be able to do the following to enable this scenario.
This would be a very large change, and right now we don't plan on doing this work in the immediate future. However, I'll raise this issue again with the team using your example here and add it to the list of good reasons to do this work. |
As a temporary workaround, a solution could also be to put all your code to create whatever custom effect you want there into a separate WinRT component (either C++, or C# compiled with NativeAOT, etc.). Then just load that and use that to create your effects. That WinRT component would only reference Win2D.uwp, and it would handle creatin the correct brush and everything else needed. It'd just expose an API for you to get that brush, so there wouldn't be namespace conflicts. I understand it would add a bit of complexity, binary size and memory use but it could solve your issue for now 🙂 |
I already tried referencing win2d.winui in the main project + a WinRT component that referencing win2d.uwp, it does NOT work. It simply exceptions out |
In WinUI3, the
SystemBackdrop
of aMicrosoft.UI.Xaml.Window
accepts aWindows.UI.Composition.CompositionBrush
in itsICompositionSupportsSystemBackdrop
parameter. See thisDoing anything non-trivial requries the
win2d.uwp
package, which would conflict withwin2d.winui
package. Please make them compatible.The text was updated successfully, but these errors were encountered: