-
Notifications
You must be signed in to change notification settings - Fork 698
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
'XamlBindings': undeclared identifier in C++/WinRT #2429
Comments
According to documentation linked below, It indeed works fine when using C#, and the C++/WinRT code for it is generated as well, it's just a omission of a namespace qualifier for a |
@sylveon yes it has! Glad that you were able to discover that :) |
I'm currently having to debug a runtime binding issue and the lack of x:Bind is being severely felt :( Having a compile time error would be much easier to correct. |
repro.zip |
@sylveon, gotcha, so this is just a simple bug in the C++/WinRT codegen, then? |
@RealTommyKlein can you take a look at this? This sounds like a simple fix we could make in the 3.0 timeframe? |
Yes, it's simply missing a namespace qualifier |
Yeah we can fix this for WinUI 3. I've fixed the |
Would love to see this backported to the system XAML compiler, since I use XAML Islands so I would have to wait for WinUI 3.1 to get the fix |
We'll also backport both fixes for Windows.UI.Xaml, but to set expectations for a timeline, it won't be available until the Windows SDK release in mid-2021 due to the Windows shipping schedule. |
Fixed in the Windows 11 SDK, thanks ♥ |
Describe the bug
I get the compiler error
'XamlBindings': undeclared identifier
when using x:Bind in a ControlTemplate as part of a XAML document that isn't in the root namespace with C++/WinRT.Steps to reproduce the bug
BlankApp1.Foo.MyPage
)x:Bind
in the template, for exampleFoo.MyPage.xaml.g.hpp
Expected behavior
It builds.
Version Info
Visual Studio 16.6.0 Preview 6.
NuGet package version:
C++/WinRT 2.0.200508.4
Additional context
Full output:
This also affects other use cases, like a control inheriting from another and retemplating the parent, binding some values to its own properties. (that was how I found it, because my controls are under the
MyRootNamespace.Controls
namespace)I cannot use
TemplateBinding
because I would like to provide aTargetNullValue
fallback, which is not possible withTemplateBinding
.You can find my use case here https://github.com/TranslucentTB/TranslucentTB/tree/develop. The issue can be reproduced simply by building the
Xaml
project which has no other dependencies than the community toolkit's XamlApplication, C++/WinRT and the VCTRForwarders.Moved from microsoft/cppwinrt#614
The text was updated successfully, but these errors were encountered: