显示“请稍候……"在 WPF 中扩展 TreeView 时的消息 [英] Show "Please wait.." message when expanding TreeView in WPF

查看:32
本文介绍了显示“请稍候……"在 WPF 中扩展 TreeView 时的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 TreeView 中有很多项目,而且项目也非常复杂.我不想使用虚拟化.展开 TreeView 有时需要很多时间.因此,是否有任何事件,例如:IsTreeViewExpanding"或类似的事件,我可以在其中显示诸如正在生成 TreeView...请稍候"之类的信息.我怎样才能实现这样的目标?

I have a lots of items in my TreeView and items are also very complex. I don't want to use virtualization. Expanding TreeView sometimes takes a lot of time. So therefore, is there any event like: "IsTreeViewExpanding" or something like that where I can show information like "TreeView is being generated...Please wait". How can I achieve something like that?

推荐答案

由于 WPF 的 TreeView 没有 BeforeExpand 事件,所以你好像要 hack 到 TreeViewItem 上的 OnExpanded() 方法,详细在 这篇 MSDN 论坛帖子.

Since WPF's TreeView has no BeforeExpand event, you seem to have to hack into the OnExpanded() method on the TreeViewItem, as detailed in this MSDN forum post.

这篇关于显示“请稍候……"在 WPF 中扩展 TreeView 时的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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