How to get Items count from CollectionViewSource?

后端 未结 6 679
鱼传尺愫
鱼传尺愫 2021-01-17 09:19

I am using CollectionViewSource to filter the records displayed in a ListBox. The xaml follows.

   

        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-17 09:45

    public static int Count(this ICollectionView view)
        {
            var index = 0;
            foreach (var unused in view)
            {
                index++;
            }
            return index;
        }
    

提交回复
热议问题