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
Gets the fallback filter result for scenarios where the filter is not applied.
protected virtual DataFilterResult FallbackFilterResult { get; }
Property Value
- DataFilterResult:
The fallback filter result for scenarios where the filter is not applied.
IncludedFilterResult
Gets or sets the DataFilterResult to return when an item meets filter conditions.
public DataFilterResult IncludedFilterResult { get; set; }
Property Value
- DataFilterResult:
The DataFilterResult to return when an item meets filter conditions. 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
Gets or sets whether the filter is enabled.
public bool IsEnabled { get; set; }
Property Value
- bool:
true
if the filter is enabled; otherwise,false
. The default value istrue
.
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
Identifies the IncludedFilterResult dependency property. This field is read-only.
public static readonly DependencyProperty IncludedFilterResultProperty
IsEnabledProperty
Identifies the IsEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsEnabledProperty