I have some Problems with Binding of a XmlDataProvider to the WPF TreeView.
The TreeView is XAML-Defined like this:
<TreeView ItemsSource="{Binding Path=SelectedSystemVersionHistory}"/>
and I have a HierarchicalDataTemplate in the Parent Grid Resource of the TreeView for the Nodes in the XML File:
<HierarchicalDataTemplate DataType="Documentation" ItemsSource="{Binding XPath=*}">
<TextBlock Text="{Binding XPath=@SoftwarePackage}"/>
</HierarchiclaDataTemplate>
My ViewModel has this Property:
public XmlDataProvider SelectedSystemVersionHistory
{
get
{
String file = GetHistoryFile(); //returns full Filepath
return new XmlDataProvider()
{
source = new Uri(file, UriKind.Absolute),
XPath= "History"
};
}
}
And the Xml looks like this:
<?xml version="1.0" standalone="yes" encoding="utf-8">
<History>
<Documentation SoftwarePackage="SoftwarePackageName">
<Entry>...</Entry>
</Documentation>
</History>
The Problem is the TreeView doesn't show anything, so what is wrong? I'm working on this for days now... :o( thank u for your help.