Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DomainDataSource Class

WCF RIA Services

[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.]

Provides an object for loading, filtering, grouping, and sorting data collections.


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

[TemplateVisualStateAttribute(Name = "Unchanged", GroupName = "ChangeStates")]
[TemplateVisualStateAttribute(Name = "Changed", GroupName = "ChangeStates")]
[TemplateVisualStateAttribute(Name = "Normal", GroupName = "CommonStates")]
[TemplateVisualStateAttribute(Name = "Disabled", GroupName = "CommonStates")]
[TemplateVisualStateAttribute(Name = "Idle", GroupName = "ActivityStates")]
[TemplateVisualStateAttribute(Name = "Loading", GroupName = "ActivityStates")]
[TemplateVisualStateAttribute(Name = "Submitting", GroupName = "ActivityStates")]
public class DomainDataSource : Control

The DomainDataSource type exposes the following members.

Public methodDomainDataSourceInitializes a new instance of the DomainDataSource class.

Public propertyActualHeight (Inherited from FrameworkElement.)
Public propertyActualWidth (Inherited from FrameworkElement.)
Public propertyAllowDrop (Inherited from UIElement.)
Public propertyAutoLoadGets or sets a value indicating whether Load is automatically invoked when a change occurs that impacts the query composed by the DomainDataSource.
Public propertyBackground (Inherited from Control.)
Public propertyBorderBrush (Inherited from Control.)
Public propertyBorderThickness (Inherited from Control.)
Public propertyCacheMode (Inherited from UIElement.)
Public propertyCanLoadGets a value indicating whether the control can perform a load operation based on the present state.
Public propertyClip (Inherited from UIElement.)
Public propertyCursor (Inherited from FrameworkElement.)
Public propertyDataGets the entities resulting from the last load operation, as an IEnumerable.
Public propertyDataContext (Inherited from FrameworkElement.)
Public propertyDataViewGets the current view of entities resulting from the last load operation, using a DomainDataSourceView.
Protected propertyDefaultStyleKey (Inherited from Control.)
Public propertyDesignDataGets or sets the data to use at design time.
Public propertyDesiredSize (Inherited from UIElement.)
Public propertyDispatcher (Inherited from DependencyObject.)
Public propertyDomainContext Gets or sets the DomainContext instance used for executing the load and submit operations.
Public propertyFilterDescriptorsGets the collection of FilterDescriptor objects used when performing loads.
Public propertyFilterOperatorGets or sets the logical operator used for combining FilterDescriptor objects in the filters collection.
Public propertyFlowDirection (Inherited from FrameworkElement.)
Public propertyFontFamily (Inherited from Control.)
Public propertyFontSize (Inherited from Control.)
Public propertyFontStretch (Inherited from Control.)
Public propertyFontStyle (Inherited from Control.)
Public propertyFontWeight (Inherited from Control.)
Public propertyForeground (Inherited from Control.)
Public propertyGroupDescriptorsGets the collection of grouping objects that are used to organize the data into groups.
Public propertyHasChangesGets a value indicating whether the items exposed by this DomainDataSource have pending changes.
Public propertyHeight (Inherited from FrameworkElement.)
Public propertyHorizontalAlignment (Inherited from FrameworkElement.)
Public propertyHorizontalContentAlignment (Inherited from Control.)
Public propertyIsBusyGets a value indicating whether this DomainDataSource is loading data or submitting changes.
Public propertyIsEnabled (Inherited from Control.)
Public propertyIsHitTestVisible (Inherited from UIElement.)
Public propertyIsLoadingDataGets a value indicating whether the DomainDataSource is currently loading data.
Public propertyIsSubmittingChangesGets a value indicating whether the DomainDataSource is currently submitting changes as a result of a call to SubmitChanges.
Public propertyIsTabStop (Inherited from Control.)
Public propertyLanguage (Inherited from FrameworkElement.)
Public propertyLoadCommandGets an ICommand that invokes Load on this DomainDataSource.
Public propertyLoadDelayGets or sets the delay before an automatic data loading operation is started.
Public propertyLoadIntervalGets or sets the duration between two successive data loading operations in a progressive data loading scenario.
Public propertyLoadSizeGets or sets the maximum number of items to load each time a Load is executed. When equal to 0, all requested entities will be loaded.
Public propertyMargin (Inherited from FrameworkElement.)
Public propertyMaxHeight (Inherited from FrameworkElement.)
Public propertyMaxWidth (Inherited from FrameworkElement.)
Public propertyMinHeight (Inherited from FrameworkElement.)
Public propertyMinWidth (Inherited from FrameworkElement.)
Public propertyName (Inherited from FrameworkElement.)
Public propertyOpacity (Inherited from UIElement.)
Public propertyOpacityMask (Inherited from UIElement.)
Public propertyPadding (Inherited from Control.)
Public propertyPageSizeGets or sets the number of items displayed on each page of the view returned from the Data and DataView properties, or 0 to disable paging.
Public propertyParent (Inherited from FrameworkElement.)
Public propertyProjection (Inherited from UIElement.)
Public propertyQueryNameGets or sets the name of the query to use for loading.
Public propertyQueryParametersGets the collection of Parameter objects representing arguments of the EntityQuery<TEntity> method specified by the QueryName property.
Public propertyRefreshIntervalGets or sets the interval between automatic Load operations to refresh the data with any changes that may have occurred on the server.
Public propertyRejectChangesCommandGets an ICommand that invokes RejectChanges on this DomainDataSource.
Public propertyRenderSize (Inherited from UIElement.)
Public propertyRenderTransform (Inherited from UIElement.)
Public propertyRenderTransformOrigin (Inherited from UIElement.)
Public propertyResources (Inherited from FrameworkElement.)
Public propertySortDescriptorsGets the collection of sort descriptor objects that are used to sort the data.
Public propertyStyle (Inherited from FrameworkElement.)
Public propertySubmitChangesCommandGets an ICommand that invokes SubmitChanges on this DomainDataSource.
Public propertyTabIndex (Inherited from Control.)
Public propertyTabNavigation (Inherited from Control.)
Public propertyTag (Inherited from FrameworkElement.)
Public propertyTemplate (Inherited from Control.)
Public propertyTriggers (Inherited from FrameworkElement.)
Public propertyUseLayoutRounding (Inherited from UIElement.)
Public propertyVerticalAlignment (Inherited from FrameworkElement.)
Public propertyVerticalContentAlignment (Inherited from Control.)
Public propertyVisibility (Inherited from UIElement.)
Public propertyWidth (Inherited from FrameworkElement.)

Public methodAddHandler (Inherited from UIElement.)
Public methodApplyTemplate (Inherited from Control.)
Public methodArrange (Inherited from UIElement.)
Protected methodArrangeOverride (Inherited from FrameworkElement.)
Public methodCancelLoadCancels the current data loading operation performed by this DomainDataSource, if any.
Public methodCancelSubmitCancels the current submit operation performed by this DomainDataSource, if any.
Public methodCaptureMouse (Inherited from UIElement.)
Public methodCheckAccess (Inherited from DependencyObject.)
Public methodClearClears all data from the DomainDataSource and the underlying EntitySet on the DomainContext.
Public methodClearValue (Inherited from DependencyObject.)
Public methodDeferLoadUsed to group multiple data loading operations into a single load operation.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFindName (Inherited from FrameworkElement.)
Public methodFocus (Inherited from Control.)
Public methodGetAnimationBaseValue (Inherited from DependencyObject.)
Public methodGetBindingExpression (Inherited from FrameworkElement.)
Public methodGetHashCode (Inherited from Object.)
Protected methodGetTemplateChild (Inherited from Control.)
Public methodGetType (Inherited from Object.)
Public methodGetValue (Inherited from DependencyObject.)
Public methodInvalidateArrange (Inherited from UIElement.)
Public methodInvalidateMeasure (Inherited from UIElement.)
Public methodLoadStarts a synchronous data loading operation.
Public methodMeasure (Inherited from UIElement.)
Protected methodMeasureOverride (Inherited from FrameworkElement.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodOnApplyTemplateBuilds the visual tree for the DomainDataSource when a new template is applied. (Overrides FrameworkElement.OnApplyTemplate().)
Protected methodOnCreateAutomationPeer (Inherited from UIElement.)
Protected methodOnDoubleTap (Inherited from Control.)
Protected methodOnDragEnter (Inherited from Control.)
Protected methodOnDragLeave (Inherited from Control.)
Protected methodOnDragOver (Inherited from Control.)
Protected methodOnDrop (Inherited from Control.)
Protected methodOnGotFocus (Inherited from Control.)
Protected methodOnHold (Inherited from Control.)
Protected methodOnKeyDown (Inherited from Control.)
Protected methodOnKeyUp (Inherited from Control.)
Protected methodOnLostFocus (Inherited from Control.)
Protected methodOnLostMouseCapture (Inherited from Control.)
Protected methodOnManipulationCompleted (Inherited from Control.)
Protected methodOnManipulationDelta (Inherited from Control.)
Protected methodOnManipulationStarted (Inherited from Control.)
Protected methodOnMouseEnter (Inherited from Control.)
Protected methodOnMouseLeave (Inherited from Control.)
Protected methodOnMouseLeftButtonDown (Inherited from Control.)
Protected methodOnMouseLeftButtonUp (Inherited from Control.)
Protected methodOnMouseMove (Inherited from Control.)
Protected methodOnMouseRightButtonDown (Inherited from Control.)
Protected methodOnMouseRightButtonUp (Inherited from Control.)
Protected methodOnMouseWheel (Inherited from Control.)
Protected methodOnTap (Inherited from Control.)
Protected methodOnTextInput (Inherited from Control.)
Protected methodOnTextInputStart (Inherited from Control.)
Protected methodOnTextInputUpdate (Inherited from Control.)
Public methodReadLocalValue (Inherited from DependencyObject.)
Public methodRejectChangesCancels the data changes that were performed by the underlying DomainContext.
Public methodReleaseMouseCapture (Inherited from UIElement.)
Public methodRemoveHandler (Inherited from UIElement.)
Public methodSetBinding (Inherited from FrameworkElement.)
Public methodSetValue (Inherited from DependencyObject.)
Public methodSubmitChangesSubmits the changes for every Entity in the DomainContext.
Public methodToString (Inherited from Object.)
Public methodTransformToVisual (Inherited from UIElement.)
Public methodUpdateLayout (Inherited from UIElement.)

Public eventBindingValidationError (Inherited from FrameworkElement.)
Public eventDoubleTap (Inherited from UIElement.)
Public eventGotFocus (Inherited from UIElement.)
Public eventHold (Inherited from UIElement.)
Public eventIsEnabledChanged (Inherited from Control.)
Public eventKeyDown (Inherited from UIElement.)
Public eventKeyUp (Inherited from UIElement.)
Public eventLayoutUpdated (Inherited from FrameworkElement.)
Public eventLoaded (Inherited from FrameworkElement.)
Public eventLoadedDataOccurs when a data loading operation is completed.
Public eventLoadingDataOccurs when a data loading operation is started.
Public eventLostFocus (Inherited from UIElement.)
Public eventLostMouseCapture (Inherited from UIElement.)
Public eventManipulationCompleted (Inherited from UIElement.)
Public eventManipulationDelta (Inherited from UIElement.)
Public eventManipulationStarted (Inherited from UIElement.)
Public eventMouseEnter (Inherited from UIElement.)
Public eventMouseLeave (Inherited from UIElement.)
Public eventMouseLeftButtonDown (Inherited from UIElement.)
Public eventMouseLeftButtonUp (Inherited from UIElement.)
Public eventMouseMove (Inherited from UIElement.)
Public eventMouseWheel (Inherited from UIElement.)
Public eventSizeChanged (Inherited from FrameworkElement.)
Public eventSubmittedChangesOccurs whenever a submit operation is completed.
Public eventSubmittingChangesOccurs whenever a submit operation is started.
Public eventTap (Inherited from UIElement.)
Public eventTextInput (Inherited from UIElement.)
Public eventTextInputStart (Inherited from UIElement.)
Public eventTextInputUpdate (Inherited from UIElement.)
Public eventUnloaded (Inherited from FrameworkElement.)

Public fieldStatic memberAutoLoadPropertyIdentifies the AutoLoad dependency property.
Public fieldStatic memberCanLoadPropertyIdentifies the CancelLoad dependency property.
Public fieldStatic memberDataPropertyIdentifies the Data dependency property.
Public fieldStatic memberDataViewPropertyIdentifies the DataView dependency property.
Public fieldStatic memberDesignDataPropertyIdentifies the DesignData dependency property.
Public fieldStatic memberDomainContextPropertyIdentifies the DomainContext dependency property.
Public fieldStatic memberFilterOperatorPropertyIdentifies the FilterOperator dependency property.
Public fieldStatic memberHasChangesPropertyIdentifies the HasChanges dependency property.
Public fieldStatic memberIsBusyPropertyIdentifies the IsBusy dependency property.
Public fieldStatic memberIsLoadingDataPropertyIdentifies the IsLoadingData dependency property.
Public fieldStatic memberIsSubmittingChangesPropertyIdentifies the IsSubmittingChanges dependency property.
Public fieldStatic memberLoadDelayPropertyIdentifies the LoadDelay dependency property.
Public fieldStatic memberLoadIntervalPropertyIdentifies the LoadInterval dependency property.
Public fieldStatic memberLoadSizePropertyIdentifies the LoadSize dependency property.
Public fieldStatic memberPageSizePropertyIdentifies the PageSize dependency property.
Public fieldStatic memberQueryNamePropertyIdentifies the QueryName dependency property.
Public fieldStatic memberRefreshIntervalPropertyIdentifies the RefreshInterval dependency property.

Use this component to simplify the interaction between the user interface and data from a DomainContext. After specifying a DomainContext and QueryName, the DomainDataSource can load data and expose it through the Data and DataView properties.

For more information, see DomainDataSource.

The following example shows a DomainDataSource that retrieves data from a domain context named ProductDomainContext and displays the data in a DataGrid control. A query method called GetProducts() must exist on the domain service for the example to work. The DomainDataSource includes 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">  
        <RowDefinition Height="25" />
        <RowDefinition Height="Auto" />
    <riaControls:DomainDataSource x:Name="source" QueryName="GetProducts" AutoLoad="true">
            <domain:ProductDomainContext />
            <riaData:FilterDescriptorCollection LogicalOperator="And">
              <riaData:FilterDescriptor PropertyPath="Color" Operator="IsEqualTo" Value="Blue" />
              <riaData:FilterDescriptor PropertyPath="ListPrice" Operator="IsLessThanOrEqualTo">
                      RefreshEventName="SelectionChanged" />
    <ComboBox x:Name="MaxPrice" Grid.Row="0" Width="60" SelectedIndex="0">
        <ComboBoxItem Content="100" />
        <ComboBoxItem Content="500" />
        <ComboBoxItem Content="1000" />
    <data:DataGrid Grid.Row="1" ItemsSource="{Binding Data, ElementName=source}" />

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2018 Microsoft