Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
/** @property */ public Uri get_Source () /** @property */ public void set_Source (Uri value)
Property ValueThe Uri of the XML data file to use as the binding source. The default value is a null reference (Nothing in Visual Basic).
XmlDataProvider exposes the following ways to access XML data.
You can embed inline XML data using the XmlDataProvider class.
You can set this property to the Uri of an XML data file.
If the Source property is set, then any inline XML data is discarded. If the Document property is set, then the Source property is cleared and any inline XML data is discarded.
Setting the following properties will implicitly cause this XmlDataProvider object to refresh: Source, Document, XmlNamespaceManager, and XPath. When changing multiple refresh-causing properties, the use of DeferRefresh is recommended.
In some applications, embedding the XML inline within the XAML page can be inconvenient because the exact content of the data must be known at compile time. Therefore, you can obtain the data from an external XML file, as in the following example.
For the complete code sample, see XML Data Source with Embedded Data File Sample.
If the XML data resides in a remote XML file, you define access to the data by assigning an appropriate URL to the Source attribute as follows:
<XmlDataProvider x:Key="BookData" Source="http://MyUrl" XPath="Books"/>
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.