开发者

Lines between nodes in WPF TreeView

开发者 https://www.devze.com 2022-12-09 06:17 出处:网络
All I want to know is if there\'s an easy way to add lines that connect nodes in a WPF TreeView, in the same manner as Visual Studio 2008\'s Solution Explorer pane. I found one solution but there\'s a

All I want to know is if there's an easy way to add lines that connect nodes in a WPF TreeView, in the same manner as Visual Studio 2008's Solution Explorer pane. I found one solution but there's a lot of code and I want a simpler w开发者_运维知识库ay. A thread on Microsoft's Silverlight forums seems to suggest that the lack of a "lines" option is due to Silverlight compatibility.


That's pretty much the only way. You need to modify the ControlTemplate of the TreeView and to do so you need to meet the requirements for the TreeView to draw itself (which is all the extra code). I REALLY suggest you get used to ControlTemplates if you'll work with WPF, since it's a very powerful feature. Basically they did it this way to separate design from functionality.

0

精彩评论

暂无评论...
验证码 换一张
取 消