Etienne Charland
Etienne Charland

Reputation: 4024

PropertyChangedNotifier for Avalonia?

PropertyChangedNotifier is a basic function that is often needed in WPF to know when a DependencyProperty changed, as implemented here.

Has anyone converted or written a similar function for Avalonia UI, or is there a built-in feature to do the job?

I'm trying to convert the code but it's relatively complex and converting it would require extensive testing.

Upvotes: 0

Views: 1210

Answers (1)

kekekeks
kekekeks

Reputation: 3623

listBoxItem.GetObservable(ListBoxItem.IsSelectedProperty)
    .Subscribe(e => 
{
   // your handler code
});

Or just consume the observable via Reactive Extensions instead of just subscribing a handler.

Upvotes: 1

Related Questions