I have WPF aplication with a treeview that is bound to an XMLDataProvider in the XAML using HierarchicalDataTemplates. I'm trying to change the ItemsSource on the treeview at runtime because I don't know the xml filename until runtime.
What's the best way to go about doing something like this? I've tried the following which doesn't work.
XmlDataProvider dp = tree.FindResource("productsXml") as XmlDataProvider;
dp.Source = new Uri("file://products.xml");
When I change it to DynamicResource, I get the following exception.
A 'DynamicResourceExtension' cannot be set on the 'Source' property of type 'Binding'. A 'DynamicResourceExtension' can only be set on a DependencyProperty of a DependencyObject.
A 'DynamicResourceExtension' cannot be set on the 'Source' property of type 'Binding'. A 'DynamicResourceExtension' can only be set on a DependencyProperty of a DependencyObject.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.