In This Article

DataFilterBase Class

Provides an abstract base class for an IDataFilter implementation.

public abstract class DataFilterBase : DependencyObject, IDataFilter
Inheritance:
object object
Derived:
BooleanFilterBase DataFilterGroup PredicateFilter StringFilterBase
Implements:
IDataFilter

Constructors

DataFilterBase()

Initializes an instance of the class.

protected DataFilterBase()

Properties

FallbackFilterResult

The fallback filter result for scenarios where the filter is not applied.

protected virtual DataFilterResult FallbackFilterResult { get; }

Property Value

DataFilterResult

IncludedFilterResult

The DataFilterResult to return when an item meets filter conditions.

public DataFilterResult IncludedFilterResult { get; set; }

Property Value

DataFilterResult:

The default value is Included.

Remarks

This property should only be set to either Included (the default), or alternatively IncludedWithDescendants if all descendants of a filter match should always be included as well.

IsEnabled

Indicates whether the filter is enabled.

public bool IsEnabled { get; set; }

Property Value

bool:

true if the filter is enabled; otherwise, false.

Methods

Filter(object, object?)

Examines the specified item to see if meets filter conditions.

public abstract DataFilterResult Filter(object item, object? context)
Parameter Type Description
item object

The item to examine.

context object

An optional object that provides contextual information for the filter request.

Returns

DataFilterResult:

A DataFilterResult that indicates the filter result.

RaiseFilterChangedEvent()

Raises the FilterChanged event if the filter is enabled.

protected void RaiseFilterChangedEvent()

Events

FilterChanged

Occurs when the filter has changed and should be reapplied.

public event EventHandler? FilterChanged

Event Type

EventHandler

Fields

IncludedFilterResultProperty

Defines the IncludedFilterResult property.

public static readonly DependencyProperty IncludedFilterResultProperty

IsEnabledProperty

Defines the IsEnabled property.

public static readonly DependencyProperty IsEnabledProperty

Extension Methods