私のアプリケーションにはMVVMモデルに従っています。コレクションをフィルタリングする入力として機能するテキストボックスがあります。ラムダ式を使ってobservablecollectionフィルターを理解しましたが、collectionviewsourceメソッドを理解できませんでした。私はどのようにこれを使用してcollectionviewsourceメソッドを実装できますか?ここでCollectionviewsourceフィルタメソッド
は私のviewmodelクラスです:
private ObservableCollection<SPFetchCREntity> _CRmappings2 = new ObservableCollection<SPFetchCREntity>();
public ObservableCollection<SPFetchCREntity> CRmappings2
{
get { return _CRmappings2; }
set
{
_CRmappings2 = value;
RaisePropertyChanged("CRmappings2");
}
}
public ICollectionView AllCRSP
{ get; private set;}
public void UpdatePopList()
{
CRmappings2 = new ObservableCollection<SPFetchCREntity>(crentities.Where(p => p.MU_Identifier == selectmu.ToString()).ToList());
}
https://wpftutorial.net/DataViews.html – Mishka
@Mishka非常に良いことをリンク、ありがとうございました –