Introduction
In my previous article WPF: XmlDataProvider Two-Way Data Binding, I discussed how the XmlDataProvider does not natively support two-way binding and provided a simple work-a-round to address the issue. The binding in the previous article only demonstrated read and update operations. In response to several reader comments inquiring about insert and delete operations, I have updated the demo code and provided this brief article.
Background
The application in my previous article was developed with Visual Studio 2008 and targeted the 3.5 version of the .NET framework. The downloadable project above for this article was upgraded to Visual Studio 2010.
Using the code
You will notice from the screenshot below that I have added two new buttons to the form for the purpose of inserting and deleting records. Each button has a corresponding event handler to persist the changes to the source XML file.
Read more: Codeproject
In my previous article WPF: XmlDataProvider Two-Way Data Binding, I discussed how the XmlDataProvider does not natively support two-way binding and provided a simple work-a-round to address the issue. The binding in the previous article only demonstrated read and update operations. In response to several reader comments inquiring about insert and delete operations, I have updated the demo code and provided this brief article.
Background
The application in my previous article was developed with Visual Studio 2008 and targeted the 3.5 version of the .NET framework. The downloadable project above for this article was upgraded to Visual Studio 2010.
Using the code
You will notice from the screenshot below that I have added two new buttons to the form for the purpose of inserting and deleting records. Each button has a corresponding event handler to persist the changes to the source XML file.
Read more: Codeproject