Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Team Bloggers

Expert advice on XmlDataProvider usage

I came across the following Q&A from the technical chat transcript from several months ago. Our WPF data binding expert Sam Bent was the one providing the great answers. It’s excellent information about the XmlDataProvider and I thought I’d share it here. Q: What are the guidelines for using XmlDataProvider for Xml binding? Setting the data context directly on a control such as a list box seems to work. A: That works fine for one-shot use. XDP is useful if: 1. you want to switch the source to a different XML file 2. you want to pre-filter the XML via an XPath query 3. it automatically reads the XML on a background thread - avoids blocking the UI 4. it gives a convenient place to share the data among several controls 5. it gives a convenient place to assign the XmlNamespaceManager (if your XML uses namespaces) If you don't need any of this, you can skip XDP . Q: So two way binding utilizing the XmlDataProvider only works between the target and the "in memory" XML? Is there a way without Read More...
Published Friday, June 29, 2007 6:30 PM by Windows Presentation Foundation SDK

Comments

No Comments
Anonymous comments are disabled

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us