This topic has not yet been rated - Rate this topic

DataSourceProvider Class

Common base class and contract for DataSourceProvider objects, which are factories that execute some queries to produce a single object or a list of objects that you can use as binding source objects.

Namespace:  System.Windows.Data
Assembly:  WindowsBase (in WindowsBase.dll)
public abstract class DataSourceProvider : INotifyPropertyChanged, 
	ISupportInitialize

The DataSourceProvider type exposes the following members.

  NameDescription
Protected methodDataSourceProviderInitializes a new instance of the DataSourceProvider class. This is a protected constructor.
Top
  NameDescription
Public propertyDataGets the underlying data object.
Protected propertyDispatcherGets or sets the current Dispatcher object to the UI thread to use.
Public propertyErrorGets the error of the last query operation.
Public propertyIsInitialLoadEnabledGets or sets a value that indicates whether to prevent or delay the automatic loading of data.
Protected propertyIsRefreshDeferredGets a value that indicates whether there is an outstanding DeferRefresh in use.
Top
  NameDescription
Protected methodBeginInitIndicates that initialization of this object is about to begin; no implicit Refresh occurs until the matched EndInit method is called.
Protected methodBeginQueryWhen overridden in a derived class, this base class calls this method when InitialLoad or Refresh has been called. The base class delays the call if refresh is deferred or initial load is disabled.
Public methodDeferRefreshEnters a defer cycle that you can use to change properties of the provider and delay automatic refresh.
Protected methodEndInitIndicates that the initialization of this object has completed; this causes a Refresh if no other DeferRefresh is outstanding.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInitialLoadStarts the initial query to the underlying data model. The result is returned on the Data property.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnPropertyChangedRaises the PropertyChanged event with the provided arguments.
Protected methodOnQueryFinished(Object)Derived classes call this method to indicate that a query has finished.
Protected methodOnQueryFinished(Object, Exception, DispatcherOperationCallback, Object)Derived classes call this method to indicate that a query has finished.
Public methodRefreshInitiates a refresh operation to the underlying data model. The result is returned on the Data property.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public eventDataChangedOccurs when the Data property has a new value.
Protected eventPropertyChangedOccurs when a property value changes.
Top
  NameDescription
Explicit interface implemetationPrivate eventINotifyPropertyChanged.PropertyChangedOccurs when a property value changes.
Explicit interface implemetationPrivate methodISupportInitialize.BeginInitThis member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.
Explicit interface implemetationPrivate methodISupportInitialize.EndInitThis member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.
Top

DataSourceProvider is a convenience wrapper around an existing data model; it does not replace any data model. A data provider does not attempt to condense the complexity and versatility of a data model such as ADO into one single object with a few properties.

DataSourceProvider is an abstract class. Use one of the derived classes, which are XmlDataProvider and ObjectDataProvider. The DataSourceProvider is aware of the Windows Presentation Foundation (WPF) threading and dispatcher model. It assumes the thread at creation time to be the UI thread. Events will get marshaled from a worker thread to the UI thread of the application.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.