I have a hierarchical data classes like
public class MyNode
{
public string Name { get; set;}
public bool IsExpanded { get; set;}
public List<MyNode> Nodes { get; set;}
}
I could define a HierarchicalDataTemplate to bind MyNode classes to the TreeView.
<sdk:TreeView ItemsSource="{Binding RootNodes}">
<sdk:TreeView.ItemTemplate>
<sdk:HierarchicalDataTemplate ItemsSource="{Binding Nodes}">
<TextBlock Text="{Binding Name}" />
</sdk:HierarchicalDataTemplate>
</sdk:TreeView.ItemTemplate>
</sdk:TreeView>
The question is how to data-bind IsExpanded property of TreeViewItem to corresponding MyNode.IsExpanded property, so I could persist this information.
Thank you in advance, Lex