XmlDataProvider XmlDataProvider XmlDataProvider XmlDataProvider Class

Definition

Enables declarative access to XML data for data binding.

public ref class XmlDataProvider : System::Windows::Data::DataSourceProvider, System::Windows::Markup::IUriContext
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
[System.Windows.Markup.ContentProperty("XmlSerializer")]
public class XmlDataProvider : System.Windows.Data.DataSourceProvider, System.Windows.Markup.IUriContext
type XmlDataProvider = class
    inherit DataSourceProvider
    interface IUriContext
Public Class XmlDataProvider
Inherits DataSourceProvider
Implements IUriContext
Inheritance
Attributes
Implements

Remarks

Important

In a partial-trust sandbox, XmlDataProvider fails when it does not have permissions to access the given data. For more information about partial trust security, see WPF Partial Trust Security.

XmlDataProvider exposes the following ways to access XML data.

XmlDataProvider performs a full refresh of all bindings when a XmlDocument.NodeChanged event occurs. There are no optimizations for specific nodes.

The XmlDataProvider.IsAsynchronous property is set to true by default, which means that the XmlDataProvider retrieves data and produces the collection of XML nodes asynchronously by default.

Constructors

XmlDataProvider() XmlDataProvider() XmlDataProvider() XmlDataProvider()

Initializes a new instance of the XmlDataProvider class.

Properties

BaseUri BaseUri BaseUri BaseUri

This type or member supports the WPF infrastructure and is not intended to be used directly from your code.

Data Data Data Data

Gets the underlying data object.

(Inherited from DataSourceProvider)
Dispatcher Dispatcher Dispatcher Dispatcher

Gets or sets the current Dispatcher object to the UI thread to use.

(Inherited from DataSourceProvider)
Document Document Document Document

Gets or sets the XmlDocument to use as the binding source.

Error Error Error Error

Gets the error of the last query operation.

(Inherited from DataSourceProvider)
IsAsynchronous IsAsynchronous IsAsynchronous IsAsynchronous

Gets or sets a value that indicates whether node collection creation will be performed in a worker thread or in the active context.

IsInitialLoadEnabled IsInitialLoadEnabled IsInitialLoadEnabled IsInitialLoadEnabled

Gets or sets a value that indicates whether to prevent or delay the automatic loading of data.

(Inherited from DataSourceProvider)
IsRefreshDeferred IsRefreshDeferred IsRefreshDeferred IsRefreshDeferred

Gets a value that indicates whether there is an outstanding DeferRefresh() in use.

(Inherited from DataSourceProvider)
Source Source Source Source

Gets or sets the Uri of the XML data file to use as the binding source.

XmlNamespaceManager XmlNamespaceManager XmlNamespaceManager XmlNamespaceManager

Gets or sets the XmlNamespaceManager used to run XPath queries.

XmlSerializer XmlSerializer XmlSerializer XmlSerializer

Gets the inline XML content.

XPath XPath XPath XPath

Gets or sets the XPath query used to generate the data collection.

Methods

BeginInit() BeginInit() BeginInit() BeginInit()

Indicates that initialization of this object is about to begin; no implicit Refresh() occurs until the matched EndInit() method is called.

(Inherited from DataSourceProvider)
BeginQuery() BeginQuery() BeginQuery() BeginQuery()

Prepares the loading of either the inline XML or the external XML file to produce a collection of XML nodes.

DeferRefresh() DeferRefresh() DeferRefresh() DeferRefresh()

Enters a defer cycle that you can use to change properties of the provider and delay automatic refresh.

(Inherited from DataSourceProvider)
EndInit() EndInit() EndInit() EndInit()

Indicates that the initialization of this element has completed; this causes a Refresh() if no other DeferRefresh() is outstanding.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
InitialLoad() InitialLoad() InitialLoad() InitialLoad()

Starts the initial query to the underlying data model. The result is returned on the Data property.

(Inherited from DataSourceProvider)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs) OnPropertyChanged(PropertyChangedEventArgs)

Raises the PropertyChanged event with the provided arguments.

(Inherited from DataSourceProvider)
OnQueryFinished(Object) OnQueryFinished(Object) OnQueryFinished(Object) OnQueryFinished(Object)

Derived classes call this method to indicate that a query has finished.

(Inherited from DataSourceProvider)
OnQueryFinished(Object, Exception, DispatcherOperationCallback, Object) OnQueryFinished(Object, Exception, DispatcherOperationCallback, Object) OnQueryFinished(Object, Exception, DispatcherOperationCallback, Object) OnQueryFinished(Object, Exception, DispatcherOperationCallback, Object)

Derived classes call this method to indicate that a query has finished.

(Inherited from DataSourceProvider)
Refresh() Refresh() Refresh() Refresh()

Initiates a refresh operation to the underlying data model. The result is returned on the Data property.

(Inherited from DataSourceProvider)
ShouldSerializeSource() ShouldSerializeSource() ShouldSerializeSource() ShouldSerializeSource()

Indicates whether the Source property should be persisted.

ShouldSerializeXmlSerializer() ShouldSerializeXmlSerializer() ShouldSerializeXmlSerializer() ShouldSerializeXmlSerializer()

Indicates whether the XmlSerializer property should be persisted.

ShouldSerializeXPath() ShouldSerializeXPath() ShouldSerializeXPath() ShouldSerializeXPath()

Indicates whether the XPath property should be persisted.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

ISupportInitialize.BeginInit() ISupportInitialize.BeginInit() ISupportInitialize.BeginInit() ISupportInitialize.BeginInit()

This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

(Inherited from DataSourceProvider)
ISupportInitialize.EndInit() ISupportInitialize.EndInit() ISupportInitialize.EndInit() ISupportInitialize.EndInit()

This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

(Inherited from DataSourceProvider)
IUriContext.BaseUri IUriContext.BaseUri IUriContext.BaseUri IUriContext.BaseUri

This member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

Events

DataChanged DataChanged DataChanged DataChanged

Occurs when the Data property has a new value.

(Inherited from DataSourceProvider)
INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged INotifyPropertyChanged.PropertyChanged Inherited from DataSourceProvider
PropertyChanged PropertyChanged PropertyChanged PropertyChanged

Occurs when a property value changes.

(Inherited from DataSourceProvider)

Applies to

See Also