本文介绍了需要使用虚拟化和按需加载的WPF TreeView搜索示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在WPF TreeView中实现搜索功能(基本上,我需要记住上次的用户选择).我尝试了各种建议的方法,但是由于TreeView在我的TreeView中启用了,所以没有任何效果,并且只有在扩展父节点时才加载子节点(延迟加载).

I need to implement search feature in WPF TreeView(basically I need to remember the last user selection). I have tried various approaches suggested but nothing works as virtualization is enabled in my TreeView and child nodes are loaded only when a parent node is expanded(lazy loading).

任何人都知道一个示例将这三个要素(虚拟化,按需加载和搜索)实现在一起吗?

Anyone knows of a sample having these three things(Virtualization, Load-on-demand and Search) implemented together?

推荐答案

看看 MSDN论坛线程,来自MS的Bob解释了实现此功能的问题.

Have a look at this MSDN forum thread, Bob from MS explains the problem in implementing this feature.

一个再现该问题的示例也附在该线程中.

A sample reproducing the problem is also attached in that thread.

所以目前看来,这种方法尚无解决方法:(

So at present there seems to be no solution for this approach :(

这篇关于需要使用虚拟化和按需加载的WPF TreeView搜索示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 22:21