Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Filtering Data

ICollectionView has built-in functionality that enables you to designate a method to filter the data in your collection view. The Filter property accepts a Predicate delegate that specifies a Boolean method, which takes the object from the collection as an argument, examines it, and returns True if the object is included in the filtered view and False if the object is excluded. The following two examples demonstrate setting a simple filter. The first example demonstrates setting the filter on an ICollectionView object, and the second example demonstrates the method that implements that filter. These examples involve a collection of items named myItems:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint