Share via


DomainDataSource.AutoLoad 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 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)

Syntax

'Declaration
Public Property AutoLoad As Boolean
    Get
    Set
'Usage
Dim instance As DomainDataSource
Dim value As Boolean

value = instance.AutoLoad

instance.AutoLoad = value
public bool AutoLoad { get; set; }
public:
property bool AutoLoad {
    bool get ();
    void set (bool value);
}
member AutoLoad : bool with get, set
function get AutoLoad () : boolean
function set AutoLoad (value : boolean)

Property Value

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

Remarks

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.

Examples

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

<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

DomainDataSource Class

System.Windows.Controls Namespace

Other Resources

DomainDataSource