How to get TreeViewItem from HierarchicalDataTemplate item?

前端 未结 11 1424
失恋的感觉
失恋的感觉 2020-12-02 11:34

I have a TreeView which uses a HierarchicalDataTemplate to bind its data.

It looks like this:



        
11条回答
  •  一向
    一向 (楼主)
    2020-12-02 12:11

    Do you need the TreeViewItem because you're going to modify what is being displayed? If that is the case, I'd recommend using a Style to change how the item is being displayed instead of using code-behind instead of directly modifying the TreeViewItem. It should hopefully be cleaner.

提交回复
热议问题