我想做一件简单的事情:检索ListView ItemsSource以使用Linq并再次将其提供给Listview,如:
LV1.ItemsSource = LV1.ItemsSource.Where(x => x.age > 10);
我能以某种方式做到吗?
答案 0 :(得分:1)
将其投射到该类型然后绑定,
var filterResult = LV1.ItemsSource as List<yourclass>;
LV1.ItemsSource =filterResult .Where(x => x.age > 10);