A 'Binding' cannot be set on the 'Source' property of type 'Binding'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.
<TreeView Height="400" Width="400">
<TreeViewItem ItemsSource="{Binding Source={Binding Path=Data}, XPath=*,
Converter={StaticResource stringToXmlDataProviderConverter},ConverterParameter=/root }" Header="header" />
</TreeView>
What is wrong with ItemsSource="{Binding Source={Binding Path=Data}?
Data = "<root><parm1>1</parm1><parm2>2</parm2><parm3>3</parm3></root>"
I try to use this code sample. The differ is that I want to Bind the ItemsSource to data in datacontext. There is nothing wrong with the converter.
EDIT:
<TreeViewItem ItemsSource="{Binding Path=Data}" Header="Parameters" />
Fills TreeView with one element (the string). So datacontext is correct.
EDIT: This code works better. Is there a generic way to read XML in ThreeView? I don't know the structure of XML. In all examples I have seen you have to declare sub nodes types.
<TreeViewItem DataContext="{Binding Path=Data, Converter={StaticResource stringToXmlDataProviderConverter}}" ItemsSource="{Binding .}" Header="Parameters" />
Data
look like? What's its data type? What are its properties? – Gabe