ICollectionView

        this.lcv = new ListCollectionView(s);
       
this.listBox.ItemsSource = this.lcv;

       
this.filterFx = (p) => ((string)p).ToUpper().Contains(this.textBox.Text.ToUpper());
        lcv
.Filter = this.filterFx;
 

        lcv.Refresh();

       
if (lcv.Count == 0)
            lcv
.Filter = null;
       
else
            lcv
.Filter = filterFx;

posted on 2011-05-03 17:21  Y#  阅读(191)  评论(0编辑  收藏  举报

导航