I am working with WPF TreeView. I have bound the TreeView with it's DataContext property. But whenever I am trying to refresh the TreeView by clearing all the nodes, it's not allowing. I have tried
treeview1.Items.Clear();
but it throws exception.
Please suggest me how can I solve this problem?