FilterDescriptor.Operator Property
[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.]
Gets or sets the filter operator.
Namespace: System.Windows.Controls
Assembly: System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)
Syntax
'Declaration
Public Property Operator As FilterOperator
Get
Set
'Usage
Dim instance As FilterDescriptor
Dim value As FilterOperator
value = instance.Operator
instance.Operator = value
public FilterOperator Operator { get; set; }
public:
property FilterOperator Operator {
FilterOperator get ();
void set (FilterOperator value);
}
member Operator : FilterOperator with get, set
function get Operator () : FilterOperator
function set Operator (value : FilterOperator)
Property Value
Type: System.Windows.Controls.FilterOperator
The filter operator.
Remarks
The specified filter operator must be compatible with the type used for filtering.
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>