Good day!
Interested in finding the item TreeViewItem in the TreeView.
I know that MSDN had a solution, but at the moment the blocks with the code are empty and I don’t know how to be :(
In WinForms, for example, you could
if(treeView.Nodes[0].Text == "smth") { //do smth }
What about WPF?
According to the advice below, I began to comprehend the basics of MVVM, and the brain safely accumulated. I used to have data from the collection in the TreeView, and now I need to make an intermediate Tree in the ViewModel to which the TreeView binds to, or what?
If I understand correctly, you need to use banding for correct operation. There is a plug-in in vm (I made it DataContext of the window), which has two dictionary categories (dictionary), and one of the dictionaries almost every element has its own dictionary and needs to be output in this format :
- category 1
- dictionary item
- dictionary item
--- All dictionary elements of the dictionary element
- dictionary item
- category 2
- dictionary item
due to the fact that nesting is large, I’m poking around in the HierarchicalDataTemplate, but to no avail.