DomainDataSource.DomainContext 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 DomainContext instance used for executing the load and submit operations.
Namespace: System.Windows.Controls
Assembly: System.Windows.Controls.DomainServices (in System.Windows.Controls.DomainServices.dll)
Syntax
'Declaration
Public Property DomainContext As DomainContext
Get
Set
'Usage
Dim instance As DomainDataSource
Dim value As DomainContext
value = instance.DomainContext
instance.DomainContext = value
public DomainContext DomainContext { get; set; }
public:
property DomainContext^ DomainContext {
DomainContext^ get ();
void set (DomainContext^ value);
}
member DomainContext : DomainContext with get, set
function get DomainContext () : DomainContext
function set DomainContext (value : DomainContext)
Property Value
Type: System.ServiceModel.DomainServices.Client.DomainContext
The data context for the data loading and submit operations.
Examples
The following example shows a DomainDataSource control with the DomainContext property set to a domain context named ProductDomainContext.
<UserControl x:Class="ExampleApplication.MainPage"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="https://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Ria"
xmlns:riaData="clr-namespace:System.Windows.Data;assembly=System.Windows.Controls.Ria"
xmlns:domain="clr-namespace:SilverlightApplication17.Web"
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
mc:Ignorable="d">
<Grid x:Name="LayoutRoot" Background="White">
<riaControls:DomainDataSource x:Name="source" QueryName="GetProducts" AutoLoad="true">
<riaControls:DomainDataSource.DomainContext>
<domain:ProductDomainContext />
</riaControls:DomainDataSource.DomainContext>
</riaControls:DomainDataSource>
<data:DataGrid ItemsSource="{Binding Data, ElementName=source}" />
</Grid>
</UserControl>
See Also
Reference
System.Windows.Controls Namespace