Skip to content
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

[Binding SG] It is not possible to use local variables in SetBinding<TSource, TProperty> #23791

Open
jkurdek opened this issue Jul 24, 2024 · 0 comments
Assignees
Labels
area-xaml XAML, CSS, Triggers, Behaviors t/bug Something isn't working

Comments

@jkurdek
Copy link
Member

jkurdek commented Jul 24, 2024

Source generated bindings support only static getters.

string myText = "hello";
label.SetBinding(Label.RotationProperty, (Foo foo) => myText);

The above code fails as BindingSourceGenerator expects the first element after => to be the param element and it raises a type mismatch error.

Discussion: #23671 (comment)

@jkurdek jkurdek self-assigned this Jul 24, 2024
@samhouts samhouts added area-xaml XAML, CSS, Triggers, Behaviors t/bug Something isn't working labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-xaml XAML, CSS, Triggers, Behaviors t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants