Gets or sets a method used to determine if an item is suitable for inclusion in the view.
Assembly: PresentationFramework (in PresentationFramework.dll)
Property ValueType: System.Predicate<Object>
A delegate that represents the method used to determine if an item is suitable for inclusion in the view.
The current implementation does not support filtering.
This example shows how to filter data in a view.
To create a filter, define a method that provides the filtering logic. The method is used as a callback and accepts a parameter of type object. The following method returns all the Order objects with the filled property set to "No", filtering out the rest of the objects.
You can then apply the filter, as shown in the following example. In this example, myCollectionView is a ListCollectionView object.
To undo filtering, you can set the property to null:
If your view object comes from a CollectionViewSource object, you apply filtering logic by setting an event handler for the Filter event. In the following example, listingDataView is an instance of CollectionViewSource.
The following shows the implementation of the example ShowOnlyBargainsFilter filter event handler. This event handler uses the Accepted property to filter out AuctionItem objects that have a CurrentPrice of $25 or greater.
For the complete example, see Data Binding Demo.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.