0

I would like to do something when a bool property changes the value when in the view the user chages the value.

I have this:

[ObservableProperty]
bool _myProperty;

private void OnMyPropertyChanged()
{
    //DO SOMEHTING
}

In some documentation I have read that I could implement a method with MyProperty name, but the code is not execute.

The class in which this property is extends ObservableObject, so if I am not wrong the class implement INotifyPropertyChanged.

How I could I do something when the property value changes?

Thanks.

Álvaro García
  • 18,114
  • 30
  • 102
  • 193
  • I don't know how it is done with CT but with [ReactiveUI](https://www.reactiveui.net/docs/getting-started/compelling-example#create-viewmodels) it is an easy task (the assignment of `_searchResults` in the constructor is mindblowing) – Sir Rufo May 11 '23 at 14:30

0 Answers0