A collection of trees in .NET.

When I create a list box in WPF, I often set its ItemsSource as List. Is there a tree for TreeView (or what happens in ItemsSource for TreeView)?

Is there a compilation or generally accepted method for processing tree data in C # .NET?

+4
source share
5 answers

What you want to do is bind a collection of hierarchical objects to a tree view using a hierarchical data template.

I wrote a blog post on this very issue, check it out,

Display hierarchical data using WPF tree view control

+4
source

Nothing is built, as far as I know. Usually I do something like this:

class User { string Name { get; set; } List<User> { get; set; } } 

You can then use this to bind to your hierarchical management, such as TreeView.

+2
source

Of course, data can bind a source to a WPF TreeView instance. Here are a few blogs and sample posts by topic

0
source

There is an open source project that was originally Wintellect , found here called PowerCollections . Maybe there is something that can help you?

Hope this helps, Regards, Tom.

0
source

You might want to look at the XML binding via XLinq to your tree structure, for example here: http://social.msdn.microsoft.com/forums/en-US/wpf/thread/02a47e46-12e9-45fb-af18-4511f2212acb/ and here: http://www.beacosta.com/blog/?p=50 .

0
source

Source: https://habr.com/ru/post/1298934/


All Articles