WPF Xml Data Binding - updating the underlying data

Yesterday I showed an example of some WPF Xml data binding via XPath. Cooler still is the fact that (true to the spirit of data binding) when controls are updated the underlying data source (in this case Xml) is also updated. The only slight modifications to last night’s example required was the swapping the TextBlock used to show the details for a TextBox so some values could be edited, and the inclusion of a save button. In the C# “code behind” for the button click we find the XmlDataProvider and then save out the Xml. You can see it in action in this little home movie [475 KB].