Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AutoLoad Property

DomainDataSource.AutoLoad Property

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

Gets or sets a value indicating whether Load is automatically invoked when a change occurs that impacts the query composed by the DomainDataSource.

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

public bool AutoLoad { get; set; }

Property Value

Type: System.Boolean
true to indicate automatic data loading occurs; otherwise, false.

When AutoLoad is true, any property change affecting the load query will automatically invoke a Load after the specified LoadDelay. Examples of properties that impact the query are PageSize and FilterOperator. Also, changes to dependency object collections, such as FilterDescriptors and changes to the dependency properties on elements contained in those collections, will affect the query and prompt an automatic Load.

The following example shows a DomainDataSource control with the AutoLoad property set to true.

<UserControl x:Class="ExampleApplication.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://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>


Show:
© 2015 Microsoft