WPF TreeView:ExpandAll() 方法在哪里 [英] WPF TreeView: Where is the ExpandAll() method

查看:40
本文介绍了WPF TreeView:ExpandAll() 方法在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何展开 WPF 中的所有 TreeView 节点?在 WinForms 中有一个 ExpandAll() 方法可以做到这一点.

How can I expand all TreeView nodes in WPF? In WinForms there was a ExpandAll() method which does this.

推荐答案

WPF TreeView 类没有 ExpandAll 方法.因此,您必须遍历节点并将其 IsExpanded 属性设置为 true.

The WPF TreeView class does not have an ExpandAll method. Thus you'd have to loop through the nodes and set their IsExpanded properties to true.

这篇关于WPF TreeView:ExpandAll() 方法在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆