Implementing compiled bindings
stevenbrix opened this issue · comments
WinUI first introduced compiled bindings with x:Bind
many years ago. The way we implemented it has been problematic in making it a complete replacement for {Binding}
. There are many corner cases that just simply won't work, and will probably be challenging to properly implement.
I imagine that simply won't be an issue with XamlX anymore, but there is still the question of implementing compiled bindings the way that Avalanonia and Xamarin.Forms did it.
Since we want to ease migration, we need to keep x:Bind
around, but I think we should use the same implementation that Avalonia is using for their compiled bindings. The only difference is that x:Bind
is essentially equivalent to Avalonia compiled bindings with setting DataContext
to this
.
Does this seem reasonable?
We should be able to reuse the same architecture design and type resolution logic as Avalonia, but the parsing logic and emit logic we'll have to customize (since the Avalonia has different extensions and different APIs for implementing it).