Parameter 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.]
Defines parameters for domain service queries used by DomainDataSource.
Inheritance Hierarchy
System.Object
System.Windows.DependencyObject
System.Windows.Controls.Parameter
Namespace: System.Windows.Controls
Assembly: System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)
Syntax
'Declaration
Public Class Parameter _
Inherits DependencyObject
'Usage
Dim instance As Parameter
public class Parameter : DependencyObject
public ref class Parameter : public DependencyObject
type Parameter =
class
inherit DependencyObject
end
public class Parameter extends DependencyObject
The Parameter type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() |
Parameter | Initializes a new instance of the Parameter class. |
Top
Properties
Name | Description | |
---|---|---|
![]() |
Dispatcher | (Inherited from DependencyObject.) |
![]() |
ParameterName | Gets or sets the name of the parameter. |
![]() |
Value | Gets or sets the value of the parameter. |
Top
Methods
Name | Description | |
---|---|---|
![]() |
CheckAccess | (Inherited from DependencyObject.) |
![]() |
ClearValue | (Inherited from DependencyObject.) |
![]() |
Equals | (Inherited from Object.) |
![]() |
Finalize | (Inherited from Object.) |
![]() |
GetAnimationBaseValue | (Inherited from DependencyObject.) |
![]() |
GetHashCode | (Inherited from Object.) |
![]() |
GetType | (Inherited from Object.) |
![]() |
GetValue | (Inherited from DependencyObject.) |
![]() |
MemberwiseClone | (Inherited from Object.) |
![]() |
ReadLocalValue | (Inherited from DependencyObject.) |
![]() |
SetValue | (Inherited from DependencyObject.) |
![]() |
ToString | (Inherited from Object.) |
Top
Fields
Name | Description | |
---|---|---|
![]() ![]() |
ParameterNameProperty | Identifies the ParameterName dependency property. |
![]() ![]() |
ValueProperty | Identifies the Value dependency property. |
Top
Remarks
In some cases, a query method requires parameter values. Typically, a query method requires a parameter value to filter the data that is returned. The DomainDataSource class provides the QueryParameters collection to facilitate adding parameters. To add a parameter that uses a value from the user for the query, you bind a Parameter object to the user-input control that contains the value to use in the query and include that parameter in the QueryParameters collection.
Examples
The following example shows how to specify 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>
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.