WPF Tree View by Using the View Model Pattern , please read this code and u will find most of the question relating to ur problem answered.
http://www.codeproject.com
this article explores how to use the ViewModel pattern to make it easier to work with the TreeView control in WPF. Along the way, we examine why people often have difficulty with the WPF TreeView, what a ViewModel is, and two demo applications that show how to combine a TreeView with a ViewModel. One of the demos shows how to create a searchable TreeView, the other demonstrates how to implement lazy-loading (a.k.a. load-on-demand).
Main Topics
Browse All Topics





by: PlatoConsultantPosted on 2008-11-22 at 19:03:53ID: 23023465
use ur own classes to do this not the XAML as it dont provide such functionality .
it is just a designer template like in OLD winform applications.
Well, for one, you don't have to use XAML. You can just as well write your
own class derived from Window or any other type of control, and write the
code that populates the window/control. In many ways, its not very different
than the form designer
in previous versions of .NET. The designer is just a
visual representation of the code that is being generated to populate the
form. XAML, on the other hand, is just a declarative/XML representation the
objects in the window/control. You can still derive new classes or add
anything you want to the class, and you can access anything declared in the
XAML by its name as a member of the class. Hope this helps.