如何在不展开父节点的情况下访问内部TreeViewItem节点
我有一个绑定到自定义对象集合的 WPF TreeView - 每个对象都有一个 IsExpanded 属性来展开容器 TreeViewItem。我希望能够以编程方式访问每个 TreeViewItem 的控件内容,而无需扩展可视树中的父 TreeViewItem。但是,当我尝试访问所述项目而不扩展其父项时,它们似乎尚未添加到可视化树中。有谁知道解决这个问题的方法吗?
I have a WPF TreeView that is bound to a collection of custom objects - each of which has an IsExpanded property to expand the container TreeViewItem. I want to be able to programmatically access each TreeViewItem's control contents without expanding the parent TreeViewItem in the visual tree. However, when I attempt to access said items without expanding their parent it seems as if they have not been added to the visual tree yet. Does anyone know a work around for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论