如何从VirtualizedVector获取项目 [英] How to get items from VirtualizedVector

查看:75
本文介绍了如何从VirtualizedVector获取项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从FileInformationFactory返回的虚拟化向量,如果我绑定到列表视图,一切正常,但我想手动迭代对象并创建一个包装器对象。

I have a virtualized vector returned from FileInformationFactory, if I bind to list view, everything works fine, but I would like to manually iterate the object and create a wrapper object.

如果我在代码中设置了一个断点,以便已经填充了对象,这样可以正常工作。没有断点,我需要发出一个请求来获取对象,因为它是一个虚拟化的向量。提出此类请求的界面是什么?

This works fine, if I put a break point in my code so that objects are already populated. Without break point, I need to make a request to get the object since it is a virtualized vector. What is the interface to make such a request?

CAT

推荐答案

VirtualizedVector对象专门设计为绑定到listview(如

此示例
),并且不支持该场景之外的使用。我们建议想要迭代文件查询的开发人员使用Window.Storage

查询API
。例如,你可以在getFilesAsync传递的vlue周围创建你的包装器:

The VirtualizedVector object is designed specifically to be bound to a listview (as described in this sample), and usage beyond that scenario is not supported. We recommend that developers who want to iterate over a file query use the Window.Storage query APIs. For example, you could create your wrapper around the vlue passed by getFilesAsync:

storageFileQueryResult.getFilesAsync(startIndex, maxNumberOfItems).done(function(files){
   // The <files> variable implements IVectorView and can be iterated on or wrapped
});




有什么特别的吗你想实现你不认为可以做到这些吗?

Marc


Is there anything in particular that you want to achieve that you do not think could be done with these?

Marc


这篇关于如何从VirtualizedVector获取项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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