How to mix databound and static levels in a TreeView?

后端 未结 4 1570
感动是毒
感动是毒 2021-02-03 10:23

I have a collection of Database objects, each containing collections of Schema objects and User objects. I want to bind them to a TreeView, but adding

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-03 10:46

    You need to fill the properties you're using in your binding with data from your database. Currently you're using a new TreeViewItem, and using it as a datasource, so what you're saying about it seeing everything as a single node makes sense, as you've placed it in a single node.

    You need to load your database data and attach it to the properties you've used in your WPF template as binding items.

提交回复
热议问题