listcollectionview

Does ListCollectionView leak memory?

女生的网名这么多〃 提交于 2019-12-05 01:11:41
I've been investigating how to avoid memory leaks caused by strong references to the INotifyCollectionChanged event from a view model. I was playing around with using a ListCollectionView to see if that would deal with it for me. I think that the following is leaking memory, am I doing something wrong? var stuff = new ObservableCollection<string>(); while (true) { var result = new ListCollectionView(stuff); // Just to keep make sure that the memory I'm seeing // isn't waiting to be GC'd GC.Collect(); } I initially posted this as a comment, but I think it makes a better answer, so ... a) if you

WPF Using multiple filters on the same ListCollectionView

流过昼夜 提交于 2019-12-03 12:06:29
问题 I'm using the MVVM design pattern, with a ListView bound to a ListCollectionView on the ViewModel. I also have several comboboxes that are used to filter the ListView. When the user selects an item from the combobox, the ListView is filtered for the selected item. Whenever I want to filter on top of what is already filtered, it undoes my previous filter like it never happened. The same is also true for removing a filter. Removing a filter for one combobox removes all filters and displays the

WPF Using multiple filters on the same ListCollectionView

妖精的绣舞 提交于 2019-12-03 02:27:06
I'm using the MVVM design pattern, with a ListView bound to a ListCollectionView on the ViewModel. I also have several comboboxes that are used to filter the ListView. When the user selects an item from the combobox, the ListView is filtered for the selected item. Whenever I want to filter on top of what is already filtered, it undoes my previous filter like it never happened. The same is also true for removing a filter. Removing a filter for one combobox removes all filters and displays the original list. Is it possible to have multiple, separate filters on the same ListCollectionView? Am I