"how to change xmldataprovider source in wpf at runtime?" Code Answer


you can get the xmldataprovider instance by writing (xmldataprovider)this.resources["organization"] in the code file.

you can then set the source property to a path from a file dialog.

for example:

var provider = (xmldataprovider)this.resources["organization"];
var dialog = new openfiledialog();
dialog.filter = "xml files|*.xml";
if (dialog.showdialog(this)) {
    provider.source = new uri(dialog.filename, urikind.absolute);
By divenex on May 26 2022
Only authorized users can answer the Search term. Please sign in first, or register a free account.