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

About ObservableCollection (Help)

20 Feb 2019, 03:47

1.png
1.png (5.31 KiB) Viewed 399 times
2.png
2.png (23.43 KiB) Viewed 399 times
3.png
3.png (9.28 KiB) Viewed 399 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

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 1943
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: 15
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: 2925
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: No registered users and 4 guests