It seems that add and remove cannot activate ObservableCollection to notify changes. How to solve this problem? #16334
Answered
by
maxkatz6
IronEaterBeast
asked this question in
Q&A
-
My view model:
Can activate:
Cannot activate Did I miss something? |
Beta Was this translation helpful? Give feedback.
Answered by
maxkatz6
Jul 17, 2024
Replies: 1 comment 3 replies
-
Which changes do you want to activate? Adding a new item to the array won't notify parent view model about any changes. Instead you need to subscribe on |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not how it works. Normally "Property changed" event only is raised when any actual property is changed.
But since you implement your own ViewModelBase, that's up to you. Still - you wrote no code to call RaisePropertyChanged when collection items are changed. Setter won't be executed in this situation obviously.
AllContentOC.CollectionChanged still will work, when collection is changed.
But if you want to subscribe on property changes of th…