Compartilhar via


FilterDescriptor Class

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Represents a filter description for query operations in a DomainDataSource object.

Inheritance Hierarchy

System.Object
  System.Windows.DependencyObject
    System.Windows.Controls.FilterDescriptor

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)

Syntax

'Declaration
Public Class FilterDescriptor _
    Inherits DependencyObject
'Usage
Dim instance As FilterDescriptor
public class FilterDescriptor : DependencyObject
public ref class FilterDescriptor : public DependencyObject
type FilterDescriptor =  
    class
        inherit DependencyObject
    end
public class FilterDescriptor extends DependencyObject

The FilterDescriptor type exposes the following members.

Constructors

  Name Description
Public method FilterDescriptor() Initializes a new instance of the FilterDescriptor class with default values.
Public method FilterDescriptor(String, FilterOperator, Object) Initializes a new instance of the FilterDescriptor class with the specified property to use for filtering, the operator to use when evaluating the filtering check, and the filter value.

Top

Properties

  Name Description
Public property Dispatcher (Inherited from DependencyObject.)
Public property IgnoredValue Gets or sets the value that is not applied to a query operation for filtering.
Public property IsCaseSensitive Gets or sets a value indicating whether the FilterDescriptor is case sensitive for string values.
Public property Operator Gets or sets the filter operator.
Public property PropertyPath Gets or sets the name of the property path used as the data value to assess whether the entity meets the filter check.
Public property Value Gets or sets the value to use for evaluating the filter condition.

Top

Methods

  Name Description
Public method CheckAccess (Inherited from DependencyObject.)
Public method ClearValue (Inherited from DependencyObject.)
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetAnimationBaseValue (Inherited from DependencyObject.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method GetValue (Inherited from DependencyObject.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ReadLocalValue (Inherited from DependencyObject.)
Public method SetValue (Inherited from DependencyObject.)
Public method ToString (Inherited from Object.)

Top

Fields

  Name Description
Public fieldStatic member DefaultIgnoredValue The default value of the IgnoredValue property.
Public fieldStatic member IgnoredValueProperty Identifies the IgnoredValue dependency property.
Public fieldStatic member IsCaseSensitiveProperty Identifies the IsCaseSensitive dependency property.
Public fieldStatic member OperatorProperty Identifies the Operator dependency property.
Public fieldStatic member PropertyPathProperty Identifies the PropertyPath dependency property.
Public fieldStatic member ValueProperty Identifies the Value dependency property.

Top

Remarks

The DomainDataSource control provides the FilterDescriptors collection to enable you to filter the data that is returned by the query. By adding filters, you can specify that only entities which meet the condition in the filter are loaded from the domain context. You define the logical relationship between different filters by setting the FilterOperator property on the DomainDataSource object. The FilterOperator property supports any value in the FilterDescriptorLogicalOperator enumerator.Within a FilterDescriptor instance, you set the Operator property to specify the type of comparison to use when filtering. Filter descriptors support the operations in the FilterOperator enumerator.

Examples

The following example shows two filter descriptors that are connected by a logical AND statement. One filter depends on user input and one filter is specified in the declarative syntax.

<Grid x:Name="LayoutRoot" Background="White">  
    <Grid.RowDefinitions>
        <RowDefinition Height="25" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <riaControls:DomainDataSource x:Name="source" QueryName="GetProducts" AutoLoad="true">
        <riaControls:DomainDataSource.DomainContext>
            <domain:ProductDomainContext />
        </riaControls:DomainDataSource.DomainContext>   
        <riaControls:DomainDataSource.FilterDescriptors>
            <riaData:FilterDescriptorCollection LogicalOperator="And">
              <riaData:FilterDescriptor PropertyPath="Color" Operator="IsEqualTo" Value="Blue" />
              <riaData:FilterDescriptor PropertyPath="ListPrice" Operator="IsLessThanOrEqualTo">
                  <riaControls:ControlParameter 
                      ControlName="MaxPrice" 
                      PropertyName="SelectedItem.Content" 
                      RefreshEventName="SelectionChanged" />
              </riaData:FilterDescriptor>
            </riaData:FilterDescriptorCollection>
        </riaControls:DomainDataSource.FilterDescriptors>
    </riaControls:DomainDataSource>
    <ComboBox x:Name="MaxPrice" Grid.Row="0" Width="60" SelectedIndex="0">
        <ComboBoxItem Content="100" />
        <ComboBoxItem Content="500" />
        <ComboBoxItem Content="1000" />
    </ComboBox>
    <data:DataGrid Grid.Row="1" ItemsSource="{Binding Data, ElementName=source}" />
</Grid>

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Windows.Controls Namespace