如何做数据虚拟化的Windows Phone的在线内容? [英] How to do Data Virtualization for online content in windows phone?

查看:118
本文介绍了如何做数据虚拟化的Windows Phone的在线内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,它从互联网上获取的内容。将这些信息是如此之大,可以不适合在内存中。

I have an app which gets content from internet. those pieces of information are so large and can't fit in memory.

LongListSelector 确实 UI虚拟化好。遗体数据虚拟化。我认为,解决办法是在数据库中的数据保存第一则显示它

LongListSelector does UI Virtualization well. remains Data Virtualization. I thought the solution is to save data in database first then show it.

我不知道该怎么做,这些都是在我的脑海的问题:

I have no idea how to do it and these are questions in my head:


  • 是我应该怎么办?数据虚拟化

  • ,如果没有足够的空间会发生什么。

  • 任何源或尖赞赏。

  • Is that how I should do Data Virtualization?
  • what happens if there is no enough space.
  • any source or tip is appreciated.

感谢。

推荐答案

数据虚拟化的基本思路是创建自定义的集合,可以加载和放大器;返回点播项目(S)(无内存加载之前全套)。以下是从根本上简化了执行(摘自的这个博客帖子):

Basic idea of data virtualization is creating custom collection that can load & return item(s) on-demand (without prior loading complete set in memory). Following is radically simplified implementation (adapted from this blog post) :

namespace VirtualizingDataTest
{
  public class VirtualizedDataSource : IList
  { 
    public object this[int index]
    {
      get
      {
        string text = "Requesting\t" + index;

        Debug.WriteLine(text);
        return "Item " + index;
      }
      set
      {
        throw new NotImplementedException();
      }
    }
}

在上面的例子,新项创建于要求。在你的情况,如果在线资源提供了一种方法来请求特定的索引项,则不需要数据库。你可以把逻辑下载将此[] 的getter特定项目。更多参考(各种更好/更完整的实现),可以在这里找到: http://stackoverflow.com/a/6712373/2998271

In the sample above, new item created upon requested. In your case, if the online source provide a way to request item in specific index, you don't need database. You can put logic to download specific item in this[] getter. Further references (various better/more complete implementation) can be found here : http://stackoverflow.com/a/6712373/2998271

由于UI虚拟化的工作,LLS会要求只子集的项目进行显示(换句话说,将此[] 的getter不会被调用可用的所有索引,只显示给)。

Given UI virtualization working, LLS will request only sub set of items to be displayed (in other words, this[] getter won't get invoked for all index available, only those to be displayed).

这篇关于如何做数据虚拟化的Windows Phone的在线内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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