-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Try to infer DataContext type from the $parent and #named compiled binding path parts #17204
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
Conversation
You can test this PR using the following package version. |
You can test this PR using the following package version. |
We should add a note to the docs once this is merged as older versions needs the cast and users may be confused otherwise. |
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/XamlIlBindingPathHelper.cs
Outdated
Show resolved
Hide resolved
A small unexpected change to |
@MrJul good find. Fixed. |
You can test this PR using the following package version. |
What is the updated/expected behavior with this PR?
Enables shorter and cleaner syntax without explicit casts. Compiler can infer data context type from the same XAML file.
What is the current behavior?
Developers need to cast DataContext to specific view model type, because DataContext is an object.
Checklist
Fixed issues
Fixes #10957