DataFilterBase Class
Provides an abstract base class for an IDataFilter implementation.
public abstract class DataFilterBase : DependencyObject, IDataFilter
- Inheritance:
- object object
- 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.
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:
trueif 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.
Fields
IncludedFilterResultProperty
Defines the IncludedFilterResult property.
public static readonly DependencyProperty IncludedFilterResultProperty
IsEnabledProperty
Defines the IsEnabled property.
public static readonly DependencyProperty IsEnabledProperty