I'd like my tree to open with a single root node - 'Subject Areas'. When the node is expanded, the subject ares will be shown. When a subject area is expanded, a node for 'Systems' might be displayed. When the Systems node is expanded, all of the systems would be displayed. Currently, my tree opens with a number of root nodes - each one representing a subject area. How do I force that 'Subject Area' header into the root node?
Thank you.
Scott
Hello Scott,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I defined a hierarchical data structure and then I added an additional class for the RootNode. It has a string Property and an ObservableCollection of my actual data. Then I create a collection with one item of this type and set it as ItemsSource of the XamDataTree. This way the tree has the structure you want. Please let me know if you need further assistance on this matter.
Looking forward for your reply.
Impressive service. Thanks for getting back to me so quickly.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
I've modified the example that you sent me to work with a view model, but I can't seem to bind events to that view model's ICommands. Can you provide a description/sample explaining how to bind XamDataTree events to commands from a view model?
I can suggest you see this article:
http://social.technet.microsoft.com/wiki/contents/articles/18199.event-handling-in-an-mvvm-wpf-application.aspx
where it is explained how to handle events using MVVM. Please let me know if this helps you or you have further questions on this matter.