WPF ListBox事件是否已加载或更改了数据源? [英] WPF ListBox event for datasource loaded or changed ?

查看:378
本文介绍了WPF ListBox事件是否已加载或更改了数据源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究列表框上的事件列表,但是在绑定数据源时看不到一个事件.那怎么可能?

感谢皮特的回复.让我解释一下我的情况.在某些Weven机器上,我的应用程序报告其未响应.原因是,我有一个播放视频的列表框模板,因此数据绑定仅负责加载19个非常小的视频,以缩略图形式播放.我认为我的问题是病毒扫描程序扫描这些文件花费的时间太长,以至于我的程序被认为无响应.我添加了一些消息框,并且我的方法运行良好,这是问题所在的内部绑定.因此,我正在寻找一种方法来进入该过程,并使系统确信我的应用程序仍在运行.

I am working through the list of events on a listbox, and I cannot see one for when the data source has bound. How is that possible ?

Thanks for the response Pete. Let me explain my situation. There are some Weven machines on which my application reports that it is not responding. The reason is, I have a listbox template that plays videos, so the databinding is solely responsible for loading 19 very small videos, to play as thumbnails. I believe my issue is that a virus scanner is taking so long to scan those files, that my program is deemed unresponsive. I added some message boxes, and my method runs fine, it''s the internal binding that is the issue. So I am looking for a way to hook into that process and convince the system that my app is still running.

推荐答案

WPF和ASP.NET;虽然在ASP.NET中有RowDataBound事件,但它的目的/目标是ASP.NET中的绑定远不及WPF强大.在极少数情况下(我的代码无法想到),您需要利用WPF中的绑定来修改模板项,因此,需要采取一些标准的WPF机制
Ahhh, the joys of the differences between databinding in WPF and ASP.NET; while you have the RowDataBound event in ASP.NET, it''s intended/aimed at the fact that the binding in ASP.NET is nowhere near as powerful as WPF. There are very few cases (that''s code for I can''t think of any off the top of my head) where you need to hack around with a binding in WPF to change template items - there are standard WPF mechanisms that take care of this for you.


这些视频都一起播放吗?它们一次可见吗?如果没有,那么我会考虑使用虚拟化来应对它们并按需加载视频.
Do these videos all play together? Are they visible at once? If not, then I''d look at using virtualisation to cope with them and load the videos on demand.


这篇关于WPF ListBox事件是否已加载或更改了数据源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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