Class FilterControlFilter
Defines a base class for filters of the FilterControl.
Inheritance
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
[TemplatePart(Name = "PART_ResetButton", Type = typeof(Button))]
[TemplatePart(Name = "PART_Expander", Type = typeof(Expander))]
public abstract class FilterControlFilter : Control, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient
Fields
View SourceFilterValuePreviewProperty
Defines the dependency property for the FilterValuePreview property.
Declaration
public static readonly DependencyProperty FilterValuePreviewProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
FilterValueProperty
Defines the dependency property for the FilterValue property.
Declaration
public static readonly DependencyProperty FilterValueProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
HeaderProperty
Defines the dependency property for the Header property.
Declaration
public static readonly DependencyProperty HeaderProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IsExpandedProperty
Defines the dependency property for the IsExpanded property.
Declaration
public static readonly DependencyProperty IsExpandedProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
IsFilterAvailableProperty
Defines the dependency property for the IsFilterAvailable property.
Declaration
public static readonly DependencyProperty IsFilterAvailableProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ItemsSourceProperty
Defines the dependency property for the ItemsSource property.
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ResetFilterButtonToolTipProperty
Defines the dependency property of the ResetFilterButtonToolTip property.
Declaration
public static readonly DependencyProperty ResetFilterButtonToolTipProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceBinding
Gets or sets the binding that points to the property to filter.
Declaration
public Binding Binding { get; set; }
Property Value
| Type | Description |
|---|---|
| Binding |
FilterExpanded
Action that is invoked when the filter is expanded.
Declaration
public Action<FilterControlFilter> FilterExpanded { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<FilterControlFilter> |
FilterValue
Gets the value of the filter.
Declaration
public object FilterValue { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
Remarks
To set the filter value, use the SetFilterValue(object) method.
FilterValuePreview
Gets a formatted preview text of the filter value.
Declaration
public string FilterValuePreview { get; }
Property Value
| Type | Description |
|---|---|
| string |
FilteringEnabled
Indicates whether the filtering is enabled.
Declaration
protected bool FilteringEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Header
Gets or sets the header of the filter.
Declaration
public object Header { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
Id
Gets the unique id of this instance.
Declaration
public string Id { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsExpanded
Indicates whether the filter is expanded.
Declaration
public bool IsExpanded { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsFilterAvailable
Indicates whether the filter is available at all.
Declaration
public bool IsFilterAvailable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
ItemsSource
Gets the ItemsSource.
Declaration
public ICollectionView ItemsSource { get; }
Property Value
| Type | Description |
|---|---|
| ICollectionView |
PartExpander
Gets or sets the expander part.
Declaration
protected Expander PartExpander { get; }
Property Value
| Type | Description |
|---|---|
| Expander |
PartResetButton
Gets the reset button part.
Declaration
protected Button PartResetButton { get; }
Property Value
| Type | Description |
|---|---|
| Button |
ResetFilterButtonToolTip
Gets or sets the tooltip of the reset filter item button.
Declaration
public string ResetFilterButtonToolTip { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceCreateId()
Gets the id of this instance
Declaration
protected virtual string CreateId()
Returns
| Type | Description |
|---|---|
| string | The id of this instance. |
FilterValueChanged(DependencyPropertyChangedEventArgs)
Called when the filter value has been changed.
Declaration
protected abstract void FilterValueChanged(DependencyPropertyChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyPropertyChangedEventArgs | args |
FindInObject(object)
Return true of the FilterValue is part of the given objects property.
Declaration
protected abstract bool FindInObject(object filterValue)
Parameters
| Type | Name | Description |
|---|---|---|
| object | filterValue |
Returns
| Type | Description |
|---|---|
| bool | True if the FilterValue is part of the given objects property., otherwise false |
FormatFilterValuePreview(object)
Formats the filter value to a readable string.
Declaration
protected abstract string FormatFilterValuePreview(object filterValue)
Parameters
| Type | Name | Description |
|---|---|---|
| object | filterValue | The filter value. |
Returns
| Type | Description |
|---|---|
| string | The filter value as readable string. |
GetConvertedPropertyValue(object)
Gets the converted value of the Binding for the given bindingProperty, converted with the IValueConverter.
Declaration
protected object GetConvertedPropertyValue(object bindingProperty)
Parameters
| Type | Name | Description |
|---|---|---|
| object | bindingProperty | The object that contains the Binding. |
Returns
| Type | Description |
|---|---|
| object | The converted value of the Binding property of the |
GetPropertyValue(object)
Gets the value of the Binding for the given item.
Declaration
protected object GetPropertyValue(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| object | item | The object that contains the Binding. |
Returns
| Type | Description |
|---|---|
| object | The value of the Binding property of the |
GetState()
Gets the state of this instance.
Declaration
protected virtual FilterState GetState()
Returns
| Type | Description |
|---|---|
| FilterState | The FilterState. |
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
Declaration
public override void OnApplyTemplate()
Overrides
View SourceOnItemsSourceChanged(ICollectionView)
Invoked when the ItemsSource has changed.
Declaration
protected virtual void OnItemsSourceChanged(ICollectionView itemsSource)
Parameters
| Type | Name | Description |
|---|---|---|
| ICollectionView | itemsSource | The items source. |
ResetFilter()
Resets the filter.
Declaration
public virtual void ResetFilter()
SetFilterValue(object)
Sets the filter value. This internally invokes the FilterChanged event to notify the parent.
Declaration
public void SetFilterValue(object filterValue)
Parameters
| Type | Name | Description |
|---|---|---|
| object | filterValue | The filter value. |
SetState(FilterState)
Sets the FilterState.
Declaration
protected virtual void SetState(FilterState filterState)
Parameters
| Type | Name | Description |
|---|---|---|
| FilterState | filterState | The FilterState. |
Events
View SourceFilterChanged
Invoked when the filter changes.
Declaration
public event FilterChangedEventHandler FilterChanged
Event Type
| Type | Description |
|---|---|
| FilterChangedEventHandler |
FilterReset
Invoked when the filter was reset.
Declaration
public event FilterResetEventHandler FilterReset
Event Type
| Type | Description |
|---|---|
| FilterResetEventHandler |