ObservableCollection Add Clear Remove, OnPropertyChanged are not triggered

ObservableCollection Add Clear Remove, OnPropertyChanged are not triggered。 There has to be a new ObservableCollection。


Attachment: SfTreeViewdemo_25e2fdb3.rar

1 Reply

SP Sreemon Premkumar Muthukrishnan Syncfusion Team June 11, 2024 02:32 PM UTC

Hi Mose,

We have checked the code snippet you shared. When adding, removing, or clearing the ObservableCollection, the CollectionChanged event of the ObservableCollection will be executed, not the OnPropertyChanged event. This is the expected behavior.

The OnPropertyChanged event gets executed when the ObservableCollection is assigned by a value. Please find the video reference below.

Regard,
Sreemon Premkumar M.


Attachment: AssignValueToObservableCollection_b51989e1.zip

Loader.
Up arrow icon