0

How do I implement the same behavior(wpf) in Avalonia?

var leftDescriptor= DependencyPropertyDescriptor.FromProperty(Canvas.LeftProperty, typeof(SomeObject));
    leftDescriptor.AddValueChanged(this, OnCanvasLeftChanged);
PopMal
  • 51
  • 1
  • 6

1 Answers1

0

You can just subscribe to changes like this: Canvas.LeftProperty.Changed.Subscribe(OnCanvasLeftChanged);

Make sure to import the System namespace, otherwise the relevant extension method from System.ObservableExtensions won't be found by the compiler.

kekekeks
  • 3,193
  • 19
  • 16