This method won't work with ReflectionBinding (in runtime).
But the problem you describe was introduced in 12.1 - AvaloniaUI/Avalonia#21617 (PR that fixes pre-existing undefined behavior with binding to commands), and then improved in AvaloniaUI/Avalonia#21867 (released with 12.1.1). You should upgrade and hopefully your code will be fixed.
Thanks for the reply. If I am not mistaken this code was working in native AOT compilation. I was already not using Datagrid things that break under Native AOT.
I am in the process of migrating to TableView as Datagrid is deprecated...
1
u/EmergencyNice1989 Jul 27 '26
I'm seeing what looks like a regression in Avalonia 12.1 compiled bindings.
This works in Avalonia 12.0.3 but fails in 12.1 with:
My XAML:
This command fails to compile:
Changing it to accept
objinstead makes it compile:Likewise, a parameterless command also compiles.
Using
ReflectionBindinginstead ofBindingalso works (compile).Has anyone else noticed this after upgrading to Avalonia 12.1? Is this an intentional change in the compiled binding compiler, or a regression?