-
Notifications
You must be signed in to change notification settings - Fork 746
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
[WASM] Custom attached property not working when used in XAML #15813
Comments
@IneedHelp Thanks for reporting this. I think the issue here is that you're using Can you try Currently, the action I think we should do is failing the build with a clear error message or producing a warning. @jeromelaban thoughts? |
@Youssef1313 YES! that was it, thank you very much!! I think I've created well over 50 projects by now trying to understand where the issue might be and why does it work when I have the Thank you! |
@Youssef1313 unfortunately now I've encountered a different problem related to this; if the attached properties are defined in an external library, when I try to reference them as such xmlns:nsHtmlIframe="using:UnoHTML5Elements.SRC.L40.NS_HTML_iframe;assembly=UnoHTML5Elements"
xmlns:nsApHtml="using:UnoHTML5Elements.SRC.L20.NS_AP_HTML;assembly=UnoHTML5Elements" it does not work, the compiler doesn't recognize the classes. xmlns:nsHtmlIframe1="clr-namespace:UnoHTML5Elements.SRC.L40.NS_HTML_iframe;assembly=UnoHTML5Elements"
xmlns:nsApHtml1="clr-namespace:UnoHTML5Elements.SRC.L20.NS_AP_HTML;assembly=UnoHTML5Elements" but then we're back to the problem where attached properties don't work. Is there something I'm doing wrong here ? //`───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Edit: using System.Windows.Markup;
[assembly: XmlnsPrefix(xmlNamespace: "http://UnoHTML5Elements.com/", prefix: "h5")]
[assembly: XmlnsDefinition(xmlNamespace: "http://UnoHTML5Elements.com/", clrNamespace: "UnoHTML5Elements.SRC.L20.NS_AP_HTML")] and then using it xmlns:h5="http://UnoHTML5Elements.com/" but with no luck :( attached properties referenced this way still don't work.. //`───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── EDIT2: xmlns:nsHtmlIframe="using:UnoHTML5Elements.SRC.L40.NS_HTML_iframe"
xmlns:nsApHtml="using:UnoHTML5Elements.SRC.L20.NS_AP_HTML" I guess all this ReSharper generated code really isn't in favor of using Uno. Note: I could just remove this comment, but I think it's better to leave it here just in case others find themselves in similar situations. |
Thanks for the update. Still, it's an interesting issue. Could you provide a repro sample that demonstrates that issue? Attached properties work in general, we're using that extensively in many libraries, so it must be a scenario we're not covering.
@Youssef1313 we could, but WinUI does not, as far as I know. |
@jeromelaban This fails to compile on WinUI |
@Youssef1313 what's the error? Is it just the type not being found or something else? |
@jeromelaban Using What is interesting tho is that |
Thanks for the update. @Youssef1313 mentioned recently that this syntax was not supported for WinUI, and I wonder if there's something contextual to the use of this particular syntax. Youssef, would you remember? |
@IneedHelp Having a Windows project in the solution shouldn't have an effect. Can you attach a repro where it works with Windows project in the solution. @jeromelaban The WinUI failure with clr-namespace is:
Once |
@Youssef1313 you're right, the Windows project in the solution doesn't have an effect, it's about having referenced the Windows SDK in the common project (the one where we do the XAML work and where I initially observed the |
@IneedHelp could you provide a repro of what you're experiencing? |
@jeromelaban interestingly I can't reproduce this anymore, something must've changed since I last experienced this behavior, when using |
As We'll probably take a breaking change in the next major to remove clr-namespace support completely from Uno targets, which will be tracked by #8339. |
Current behavior
The problem is that I can't get attached properties to work when I use them in XAML with a WASM targeted project (I haven't tried other project types).
I have created this attached property:
And used it as such in a clean/fresh WASM only project
and in the source generator there is no trace of the property being used
Expected behavior
I expect the attached property to work, but in the sample I have provided, the setter isn't hit, the callback function isn't hit.
How to reproduce it (as minimally and precisely as possible)
No response
Workaround
No response
Works on UWP/WinUI
None
Environment
No response
NuGet package version(s)
No response
Affected platforms
WebAssembly
IDE
Visual Studio 2022
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: