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
Cannot {x:Bind} to property of named XAML control in C++/WinRT #2721
Comments
Additionally, looks like neither Binding works, the rectangle is just permanently black 😞 |
Hey @sylveon would adding |
Yes, it does, but I don't want to expose it to my consumers like that. |
Oh I see that makes sense thank you for clarifying. In that case, there are ways to filter metadata, so that you don't expose this to customers. Adding @kennykerr and @BenJKuhn who may be able to help workaround this while we wait on a real fix. |
Fix will be available in WinAppSDK 1.4. |
That's great news! Any chance at backporting to UWP? |
It's very unlikely given that a workaround (as ugly as it is) exists. |
Fixed in 1.4.0. @bpulliam please close this issue as I cannot. :) |
Not fixed in system XAML :( |
We are focusing our resources and efforts on WinUI 3. The bar for backporting changes to system Xaml is very high. |
Describe the bug
The autogenerated binding code tries to find the named XAML control through the projected type rather than the implementation type, resulting in a compile-time error.
Steps to reproduce the bug
<winrt/Windows.UI.Xaml.Media.h>
to the precompiled headers (to allow SolidColorBrush to be usable)Expected behavior
The code builds fine.
Version Info
NuGet package version: [Microsoft.Windows.CppWinRT 2.0.200615.7]
Additional context
The fix should be quite simple. Here's the wrong autogenerated code:
A correct version would be:
Alternatively, I believe it would be possible to instead have
Update_
directly take the implementation type:by adjusting the generated struct declaration to refer to the implementation type, like this:
The text was updated successfully, but these errors were encountered: