Does memory leak if we set ItemSource property of a control to null in WPF? -


I have a TabControl, which has havs to two tabItems, each of these two tabiates has a listback in the selection on the changed event handler I am setting up an item source resource for the appropriate list box to clear another list with a list. Now when I continue to select each tab then why is memory spike why it is?

When you change the tab, do not try to empty the empty list, I do not think WPF Trying to display the list if it is not being displayed. When I need to create listboxes / items, I display a collection of objects:

  // has all the usual uses and uses the system. System.Collections.ObjectModel class bar by using ComponentModel: INotifyPropertyChanged {// Call your property servers, communicate} Class Bar: Viewable Collection & lt; Bars & gt; Set your list-box for  ItemsSource  as your example of   

then Bars and display each Use the data template to bar . This means that you do not have to set ItemsSource anytime (because ObsavableCollection will automatically update to listboxes, when there will be some changes) which I guess It seems to be when the leak is happening. ITSOURCE program probably will be more efficient but not guaranteed by changing it again :) if you get frustrated, do the red gate Get a glimpse of a free so you're actually doing your listbox.

Another problem may be that the listbox is not properly virtualizing, but I am missing the listboxes virtualize but you will need a second opinion for that.


Comments