peerlessDJ
Topic Author
Posts: 34
Joined: 28 Jan 2019, 06:37

About ObservableCollection (Help)

20 Feb 2019, 03:47

1.png
1.png (5.31 KiB) Viewed 1134 times
2.png
2.png (23.43 KiB) Viewed 1134 times
3.png
3.png (9.28 KiB) Viewed 1134 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
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: About ObservableCollection (Help)

21 Feb 2019, 10:47

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?
 
peerlessDJ
Topic Author
Posts: 34
Joined: 28 Jan 2019, 06:37

Re: About ObservableCollection (Help)

22 Feb 2019, 04:13

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
 
User avatar
jsantos
Site Admin
Posts: 3918
Joined: 20 Jan 2012, 17:18
Contact:

Re: About ObservableCollection (Help)

22 Feb 2019, 04:26

Thanks for the feedback! Closing this

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 14 guests