Windows应用商店应用程序的ListView闪烁/内容dispappearing [英] Windows Store App ListView flickering / content dispappearing

查看:195
本文介绍了Windows应用商店应用程序的ListView闪烁/内容dispappearing的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些麻烦的ListView 其中的ItemsSource 是非常重要的(超过5'000项)。

I have some trouble with ListView where the ItemsSource can be very important (over 5'000 items).

我的应用程序是由两个列表视图的聊天应用。

My application is that of a Chat Application consisting of two ListViews.


  1. 一个在左侧,示出了活动线程的列表线程的ListView
    (谈话)

  2. 右侧
  3. 一,显示所有邮件的会话的ListView交换。

我使用的是的DataTemplate 模式使我谈话的ListView的每一个项目定制如下:
使用 Coding4Fun 包一个聊天气泡:<一href=\"http://www.geekchamp.com/articles/getting-started-with-the-coding4fun-toolkit-windows-phone-chatbubble-control\" rel=\"nofollow\">http://www.geekchamp.com/articles/getting-started-with-the-coding4fun-toolkit-windows-phone-chatbubble-control

I am using the DataTemplatepattern so that each item of my conversation ListView is customized as follow : A chat Bubble using Coding4Fun package : http://www.geekchamp.com/articles/getting-started-with-the-coding4fun-toolkit-windows-phone-chatbubble-control

每个聊天泡泡有两个的TextBlock (一个用于消息内容,其它为时间戳)。

Each Chat Bubble has two TextBlock (one for the message content, the other for the timestamp).

后来,我打算将图片添加到这个消息。

Later, I intend to add pictures to this messages.

当用户点击了左面板的ListView的谈话,主要谈话的ListView装有相应的谈话(看到)的集合。
如果该集合是特别大(在一种情况下,我有超过10000的消息),谈话的ListView确实显示的内容,但只要切换到另一个线程,并回到previous,内容不不再显示,但它在这里,它的加载。开始滚动,使得在ListView闪烁和内容,因此,是可见的,但severly闪烁。如果我停止滚动,没有内容的显示,显示空列表。

When user clicks on a conversation from the left-panel ListView, the main conversation ListView is loaded with the corresponding conversation (observable) collection. If that collection is particularly big (in one case, I have more than 10'000 messages), the conversation ListView does show the content, but as soon as a switch to another thread and back to the previous, the content does not show anymore, although it's here, it's loaded. Starting to scroll, makes the ListView flickering and the content, therefore, is visible but severly flickering. If I stop scrolling, no content is showed, showing an empty list.

进一步的实验表明,大量收集只发生在的使用ScrollIntoView()方法的一致性这样的问题:事实上,我哗哗显示每个我谈话的ListView底部时间用户点击一个线程,这样他就可以读取的最后一个消息,而不是oldes,从而节省他不得不一路滚动到底,每次

Further tests showed that this problem occurs only with large collection in concordance of usage of ScrollIntoView() method: indeed, I whish to show the bottom of my conversation ListView each time a user clicks on a thread so that he can read the last messages instead of the oldes, therefore saving him to have to scroll all the way to the bottom, each time.

我注释掉,我做的ListView滚动至底部的行证实了这一问题。闪烁的问题已经一去不复返了。

I confirmed this issue by commenting out the line where I make the ListView to scroll to the bottom. The flickering problem is gone.

最后,我写了我的问题,我发现了一个计算器的问题,这似乎是我的情况: Windows应用商店的通用的应用程序 - ListView的怪胎

Finally, as I wrote my question, I found a stackoverflow question that seems to be my case: Windows Store universal app - ListView oddity

不幸的是,解决的办法是不是很清楚。我怎样才能解决我的问题?我应该如何使用 VirtualizingStackPanel /&GT; 使用alread一个ListView里面&LT; ListView.ItemContainerStyle&GT; ListView.ItemTemplate&GT; &LT;&DataTemplate的GT;

Unfortunately, the solution is not very clear. How can I solve my issue ? How should I use VirtualizingStackPanel/>inside a ListView that uses alread <ListView.ItemContainerStyle>, ListView.ItemTemplate>and <DataTemplate> ?

推荐答案

解决我的闪烁问题,以及如何实现虚拟化的用户界面这里描述(normaly在Windows 8.1中引入)的 HTTPS:?//www.microsoft$p$pssstore.com/articles/article.aspx p = 2216995&安培; SEQNUM = 4 是如下:

The solution to my flickering problem and how to implement UI Virtualization (normaly introduced in Windows 8.1) as described here https://www.microsoftpressstore.com/articles/article.aspx?p=2216995&seqNum=4 is as follow :

<ListView.ItemsPanel>
    <ItemsPanelTemplate>
        <VirtualizingStackPanel Orientation="Vertical"/>
    </ItemsPanelTemplate>
</ListView.ItemsPanel>

要放在一个的ListView 范围之内!

方向必须定义(立式|卧式),否则临界指数的失败发生!

Orientation must be defined ( Vertical | Horizontal ) otherwise a Critial Failure occurs !

UI虚拟化提高大型GridView的和列表视图,使大量的数据可以装载effeciently没有放慢的UI诺雷得阻止它太久。

UI Virtualization enhance large GridViews and ListViews so that huge amount data can be effeciently loaded without slowing down the UI nore blocking it for too long.

这篇关于Windows应用商店应用程序的ListView闪烁/内容dispappearing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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