stevenbrix / xamlx-winui

Bringing the XamlX Compiler Toolchain to WinUI3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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?

/cc @jkoritzinsky @RealTommyKlein

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).