Reputation: 649
I have some questions about treeview in WPF.
Upvotes: 0
Views: 342
Reputation: 20764
Robert is right, you should use MVVM and data binding. The tutorial that IMHO explained it best is here
Upvotes: 2
Reputation: 96702
Use MVVM. In your HierarchicalDataTemplate
, bind Header
and ItemsSource
to properties in your view model which implement change notification. Now any changes you make to those properties will be reflected in the TreeView
.
If you're not using MVVM and data binding to populate the TreeView
, you're wasting a lot of effort.
Upvotes: 3