DomainDataSource.QueryParameters 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 the collection of Parameter objects representing arguments of the EntityQuery<TEntity> method specified by the QueryName property.

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

Syntax

'Declaration
Public Property QueryParameters As ParameterCollection
    Get
    Private Set
'Usage
Dim instance As DomainDataSource
Dim value As ParameterCollection

value = instance.QueryParameters
public ParameterCollection QueryParameters { get; private set; }
public:
property ParameterCollection^ QueryParameters {
    ParameterCollection^ get ();
    private: void set (ParameterCollection^ value);
}
member QueryParameters : ParameterCollection with get, private set
function get QueryParameters () : ParameterCollection
private function set QueryParameters (value : ParameterCollection)

Property Value

Type: System.Windows.Controls.ParameterCollection
The collection of parameters passed to the query specified by the QueryName property.

Examples

The following example shows how to use a value from a combo box as the parameter value.

<Grid x:Name="LayoutRoot" Background="White">
    <Grid.RowDefinitions>
        <RowDefinition Height="25" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>    
    <riaControls:DomainDataSource x:Name="source" QueryName="GetProductsByColor" AutoLoad="true">
        <riaControls:DomainDataSource.DomainContext>
            <domain:ProductDomainContext />
        </riaControls:DomainDataSource.DomainContext>
        <riaControls:DomainDataSource.QueryParameters>
            <riaControls:ControlParameter 
                ParameterName="color" 
                ControlName="colorCombo" 
                PropertyName="SelectedItem.Content" 
                RefreshEventName="SelectionChanged" />
        </riaControls:DomainDataSource.QueryParameters>
    </riaControls:DomainDataSource>
    <ComboBox Width="60"  Grid.Row="0" x:Name="colorCombo">
        <ComboBoxItem Content="Black" />
        <ComboBoxItem Content="Blue" />
    </ComboBox>
    <data:DataGrid Grid.Row="1" ItemsSource="{Binding Data, ElementName=source}" />
</Grid>

See Also

Reference

DomainDataSource Class

System.Windows.Controls Namespace

Other Resources

DomainDataSource