my task is as follows: Output information from a text file in JSON format in TreeView (taking into account the object hierarchycomrade).
-
4What have you tried so far? – Edney Holder May 14 '19 at 19:41
1 Answers
Welcome aboard. Your problem can be broken down into:
- How to read a text file
- How to parse a json string
- How to build objects and lists of objects from a json string
- How to bind data to a treeview in WPF
I believe there is sufficient material online to help you accomplish each step.
On the fourth point (treeview databinding in WPF), consider an answer to another question asked elsewhere on this site (visit link):
To Fully understand how to use the wpf treeview with data binding, I went through the following tutorials in order -
1) A very simple example of treeview binding using recursion
http://testdrivendevelopment.wordpress.com/2008/07/15/databinding-wpf-treeview-using-recursion/
2) Claus Konrads simple example of data binding with the treeview. It's the most straightforward example I have come across and should get any newcomers to wpf up to speed.
http://blog.clauskonrad.net/2011/04/how-to-make-hierarchical-treeview.html
3) Mike Hillbergs tutorial shows, in detail, the ins and outs of the treeview, how it compares to other wpf controls, and how to bind data.
An aside: to get help on StackOverflow (and in many other places as well), detail your problem, what you've attempted, the expected results, errors encountered and any other necessary information.

- 184
- 2
- 11