-3

my task is as follows: Output information from a text file in JSON format in TreeView (taking into account the object hierarchycomrade).

1 Answers1

2

Welcome aboard. Your problem can be broken down into:

  1. How to read a text file
  2. How to parse a json string
  3. How to build objects and lists of objects from a json string
  4. 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.

http://blogs.msdn.com/b/mikehillberg/archive/2009/10/30/treeview-and-hierarchicaldatatemplate-step-by-step.aspx

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.

Wilbur Omae
  • 184
  • 2
  • 11