Author Topic: WPF ListBox - Worst Alternative Approach to Implementing INotifyPropertyChanged  (Read 1827 times)


  • Administrator
  • Full Member
  • *****
  • Posts: 69
There are alternate approach to implementing INotifyPropertyChanged. That would be calling the ListBox.Items.Refresh() call. It refreshes all the items in the listbox and clears out any events and styles set on each listbox item.

If you have 1000 items on the ListBox with 5 columns, if you make changes one item and one column, INotifyPropertyChanged  smartly informs the ListBox and ListBox just update the particular column of the particular item. Where as Refresh methods refreshes all the 1000 items and 5 colums, which is always a bad idea.

Refresh method is useful at the time when you want to reset all the list box items to older states. It means if you have set any events at run time for each list box items and you want to clear them out in one shot, ListBox.Items.Refresh() is the perfect way to go!
« Last Edit: October 25, 2011, 04:10:08 pm by admin softwareandfinance »


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1