Binding to XML Data

WPF provides support for XmlDataProvider, which enables you to easily bind to XML data. With hardly any code and only declarative markup, you can bind to elements from an external XML file.

Consider the following XML file:

<?xml version="1.0" encoding="utf-8" ?> <Employees xmlns=""> <Employee> <Name>Jonah Baker</Name> <Address>155, Sunshine Apts, 6th Street, Virginia</Address> <Designation>Manager</Designation> </Employee> <Employee> <Name>Kyle Patrick</Name> <Address>Gordon Bungalows, Behind Lake Tahoe, USA</Address> <Designation>Manager</Designation> </Employee> <Employee> <Name>Azhar Umman</Name> <Address>707, 5th Floor, StreetSide Western Building, Harrington Road, NYC</Address> <Designation>Manager</Designation> </Employee> ...

Get XAML Developer Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.