Open maxkatz6 opened 1 month ago
Current obsolete API that still works:
public class InstancedBinding
{
public static InstancedBinding TwoWay(
IObservable<object?> observable,
IObserver<object?> observer,
BindingPriority priority = BindingPriority.LocalValue);
}
var instancedBinding = InstancedBinding.TwoWay(/* */);
BindingOperations.Apply(menuItem, MenuItem.IsCheckedProperty, instancedBinding);
See discussion for more details https://github.com/AvaloniaUI/Avalonia/discussions/16257
Right now, there is no stable API after binding refactoring, that allows creating TwoWay observable bindings, only an obsolete API to be removed in 12. We need to implement a replacement API before that.
Also, we might want to support twoway observable bindings in XAML as well, something that we didn't have before. It should be possible by checking if target property implements both IObserver and IObservable of the same type.