我有一堂课
Class ABC()
{
public string Name{get;set;}
public string Category{get;set;}
}
此类形成的列表具有以下价值:-
Name = "A", Category = "Alphabet"
Name = "1", Category = "Numeric"
Name = "2", Category = "Numeric"
Name = "B", Category = "Alphabet"
Name = "A", Category = "Alphabet"
我在上面的列表中应用了过滤器(使用 ICollectionView),仅基于类别为“字母”,结果列表是:-
Name = "A", Category = "Alphabet"
Name = "B", Category = "Alphabet"
Name = "A", Category = "Alphabet"
这工作正常,但我无法从列表中过滤掉这个重复的条目。我正在使用 WPF MVVM。请帮忙。