Trigger Filter on CollectionViewSource

前端 未结 6 1056
庸人自扰
庸人自扰 2020-12-04 08:27

I am working on a WPF desktop application using the MVVM pattern.

I am trying to filter some items out of a ListView based on the text typed in a

6条回答
  •  伪装坚强ぢ
    2020-12-04 09:20

    Nowadays, you often don't need to explicitly trigger refreshes. CollectionViewSource implements ICollectionViewLiveShaping which updates automatically if IsLiveFilteringRequested is true, based upon the fields in its LiveFilteringProperties collection.

    An example in XAML:

      
        
          FilteredProperty1
          FilteredProperty2
        
      
    

提交回复
热议问题