Export (0) Print
Expand All

FilterDescriptor Class

WCF RIA Services

[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.

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

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

'Declaration
Public Class FilterDescriptor _
	Inherits DependencyObject
'Usage
Dim instance As FilterDescriptor

The FilterDescriptor type exposes the following members.

  NameDescription
Public methodFilterDescriptorInitializes a new instance of the FilterDescriptor class with default values.
Public methodFilterDescriptor(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

  NameDescription
Public propertyDispatcher (Inherited from DependencyObject.)
Public propertyIgnoredValueGets or sets the value that is not applied to a query operation for filtering.
Public propertyIsCaseSensitiveGets or sets a value indicating whether the FilterDescriptor is case sensitive for string values.
Public propertyOperatorGets or sets the filter operator.
Public propertyPropertyPathGets or sets the name of the property path used as the data value to assess whether the entity meets the filter check.
Public propertyValueGets or sets the value to use for evaluating the filter condition.
Top

  NameDescription
Public methodCheckAccess (Inherited from DependencyObject.)
Public methodClearValue (Inherited from DependencyObject.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetAnimationBaseValue (Inherited from DependencyObject.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodGetValue (Inherited from DependencyObject.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodReadLocalValue (Inherited from DependencyObject.)
Public methodSetValue (Inherited from DependencyObject.)
Public methodToString (Inherited from Object.)
Top

  NameDescription
Public fieldStatic memberDefaultIgnoredValueThe default value of the IgnoredValue property.
Public fieldStatic memberIgnoredValuePropertyIdentifies the IgnoredValue dependency property.
Public fieldStatic memberIsCaseSensitivePropertyIdentifies the IsCaseSensitive dependency property.
Public fieldStatic memberOperatorPropertyIdentifies the Operator dependency property.
Public fieldStatic memberPropertyPathPropertyIdentifies the PropertyPath dependency property.
Public fieldStatic memberValuePropertyIdentifies the Value dependency property.
Top

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.

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>


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