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

WIP: Typed bindings #5510

Closed
wants to merge 7 commits into from
Closed

WIP: Typed bindings #5510

wants to merge 7 commits into from

Conversation

grokys
Copy link
Member

@grokys grokys commented Feb 18, 2021

What does the pull request do?

Still a work in progress, but opening a PR for visibility.

Implements typed bindings which provide a non-boxing, no-reflection pipeline for binding values.

The TypedBinding{TIn, TOut} class represents a strongly-typed binding as opposed to Binding which boxes value types. It is represented as a set of delegates:

  • Read reads the value given a binding input
  • Write writes a value given a binding input
  • Links holds a collection of delegates which when passed a binding input return each object traversed by Read. For example if Read is implemented as x => x.Foo.Bar.Baz then there would be three links: x => x.Foo, x => x.Foo.Bar and x => x.Foo.Bar.Baz. These links are used to subscribe to change notifications.

Basic code should mostly work but still needs integration with the XAML compiler. Currently typed bindings can only be created from lambda expressions at runtime.

grokys added a commit to AvaloniaUI/Avalonia.Controls.TreeDataGrid that referenced this pull request Feb 19, 2021
@grokys
Copy link
Member Author

grokys commented Dec 6, 2021

Closing this; will reopen in a slightly different form soon.

@grokys grokys closed this Dec 6, 2021
grokys added a commit that referenced this pull request Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant