-
Notifications
You must be signed in to change notification settings - Fork 524
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
Bug: Inherited interface members are not generated for XAML controls #1715
Comments
Hi Tim, this is by design. I would like to get rid of Xaml altogether as it only works well with C#. Initially, I just attempted to reduce the impact of its huge API surface by limiting code gen as much as possible. That's what the windows-rs/crates/libs/bindgen/src/classes.rs Lines 29 to 32 in 1ae0b4d
But this is just a bandage to stop the bleeding. Ultimately, I'm leaning towards having a short list of excluded namespaces for the |
That's unfortunate, even if understandable. I suppose there's my motivation to move to WinUI 2 then. Still, is this something that should be added to the FAQ, or is XAML with native code such a niche topic that only a handful of users would even ask? |
The Xaml team have been silent on microsoft/microsoft-ui-xaml#2488 so it's understandable that there might be some confusion, so an FAQ entry seems appropriate. As you know, C++ struggles with Xaml for various reasons. Rust basically has all of the same issues except that its compiler is many times slower than the C++ compiler, making it even less appealing. |
Which crate is this about?
windows
Crate version
0.35.0
Summary
For Windows Runtime types, inherited interface members should show up for
coclass
es that derive from those interfaces. This doesn't appear to work (any more) for stock UWP XAML controls.Toolchain version/configuration
No response
Reproducible example
Crate manifest
Expected behavior
The code should compile.
Actual behavior
The compiler issues the following error:
Looking into the generated
impl Button
block it seems that only the immediateButton
members are generated. None of the derived interface members show up.Additional comments
This used to work as expected in the past (such as 0.18.0, using the
build!
macro). It also appears to work with the Windows App SDK/WinUI 3 (as illustrated in this sample). It just doesn't work with the stock UWP XAML controls (I haven't checked WinUI 2).The text was updated successfully, but these errors were encountered: