Page 1 of 1

About ObservableCollection (Help)

Posted: 20 Feb 2019, 03:47
by peerlessDJ
1.png
1.png (5.31 KiB) Viewed 398 times
2.png
2.png (23.43 KiB) Viewed 398 times
3.png
3.png (9.28 KiB) Viewed 398 times
In Xaml, ObservableCollection is binded on ListBox. Now, i attempt to change property(eg filename) of one item, and call OnPropertyChanged, why this item is not changed

Re: About ObservableCollection (Help)

Posted: 21 Feb 2019, 10:47
by sfernandez
Hi, if I understand correctly, you are changing a property of an ExeShortcut item, so you need to notify of that property change, not that the whole collection of items changed.
To do that your item has to implement INotifyPropertyChanged interface, and then call PropertyChanged delegate on the modified item with the property "FileName".
Could you please try it and let us know if worked?

Re: About ObservableCollection (Help)

Posted: 22 Feb 2019, 04:13
by peerlessDJ
Hi, if I understand correctly, you are changing a property of an ExeShortcut item, so you need to notify of that property change, not that the whole collection of items changed.
To do that your item has to implement INotifyPropertyChanged interface, and then call PropertyChanged delegate on the modified item with the property "FileName".
Could you please try it and let us know if worked?
Thank you. It works

Re: About ObservableCollection (Help)

Posted: 22 Feb 2019, 04:26
by jsantos
Thanks for the feedback! Closing this