ac# wpf 列表框的加载屏幕

发布于 2024-08-28 19:54:34 字数 326 浏览 7 评论 0原文

我使用的是一个列表框,其中平均有大约 500 个可以排序和搜索的缩略图(项目)。

由于我使用默认的数据绑定和搜索描述符(我听说由于反射而速度很慢),因此列表在加载、排序和搜索时需要明显暂停几秒钟(列表根据搜索的内容动态更新)框,因此输入的前一个或两个字母非常慢)。

我认为我不能完全消除反射给项目的时间范围,而且速度也不是非常重要,但我想要某种延迟的图形指示,这样它就不会混淆用户。我怎样才能做一些类似网站视频加载屏幕的事情,其中​​列表框呈灰色,并且某种加载圆圈指示它正在处理,直到列表准备好?或者甚至只是将“正在加载...”字样变灰几秒钟也可以。有什么想法吗?

预先感谢您的帮助和建议!

I'm using a list box where there are on average about 500 thumbnails (items) that can be sorted and searched.

Since I'm using default databinding and search descriptors (which I've heard are slow due to reflection) the list takes a noticeable pause of a few seconds loading, sorting, and searching (the list dynamically updates based on the contents of the search box so the first one or two letters typed are really slow).

I don't think I can fully do away with reflection give the timeframe for the project, and speed isn't super essential, but I'd like some kind of graphical indication of the delay so it doesn't confuse the user. How could I do something like a website video loading screen where the listbox grays out and some kind of loading circle indicates it's processing until the list is ready? Or even just grayed out with the words "Loading..." for a few seconds could work. Any ideas?

Thanks in advance for your help and suggestions!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

走过海棠暮 2024-09-04 19:54:34

Silverlight-Controlkit 附带了一个非常方便的“忙碌指示器”控件...太糟糕了,默认情况下 WPF 似乎没有这样的东西。

但我发现这对你来说似乎是相当的控制:
http:// /sweux.com/blogs/pombeiro/index.php/2009/12/01/a-busy-state-indicator-attached-behavior/

下载源:
http://gallery.expression.microsoft.com/en-us/BusyIndi​​cator

Silverlight-Controlkit comes with a very handy "busyindicator"-control... too bad there seems to be no such thing for WPF by default.

But I found this seemfully comparable control for you:
http://sweux.com/blogs/pombeiro/index.php/2009/12/01/a-busy-state-indicator-attached-behavior/

download-source:
http://gallery.expression.microsoft.com/en-us/BusyIndicator

心清如水 2024-09-04 19:54:34

正如 Veer 所写,BackgroundWorker 可能是您最好的选择。

有关进度和/或延迟的图形指示,请查看

http://www .codeproject.com/KB/WPF/WPF_Loading_Wait_Adorner.aspx

它看起来几乎正是您想要做的。

Like Veer wrote, BackgroundWorker is probably your best bet.

For the graphical indication of progress and/or delay, take a look at

http://www.codeproject.com/KB/WPF/WPF_Loading_Wait_Adorner.aspx

It looks like pretty much exactly what you want to do.

拥抱我好吗 2024-09-04 19:54:34

尝试 BackgroundWorker

使用 DoWork 方法更新您的列表根据搜索关键字动态
使用 ProgressChanged 方法用一些显示“正在加载”的动画来更新您的 UI。可以使用 ProgressBar

使用 Dispatcher 来访问 DoWork 方法内的列表

Try BackgroundWorker

Use the DoWork method to update your list dynamically based on the search keyword
Use the ProgressChanged method to update your UI with some animation saying 'Loading'. A ProgressBar could be used

Use Dispatcher to access your list inside the DoWork method

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文