FilterDescriptorLogicalOperator Enumeration
[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.]
Defines values that represent logical operators for filter collections.
Namespace: System.Windows.Controls
Assembly: System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)
Syntax
'Declaration
Public Enumeration FilterDescriptorLogicalOperator
'Usage
Dim instance As FilterDescriptorLogicalOperator
public enum FilterDescriptorLogicalOperator
public enum class FilterDescriptorLogicalOperator
type FilterDescriptorLogicalOperator
public enum FilterDescriptorLogicalOperator
Members
Member name | Description | |
---|---|---|
And | Filters are combined by using the AND operator. | |
Or | Filters are combined by using the OR operator. |
Remarks
You apply a FilterDescriptorLogicalOperator value to the FilterOperator property on the DomainDataSource class.
Examples
The following example shows two filter descriptors that are connected by a logical AND operator. 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>