WPF:最适合显示大量文本的 UI 元素? [英] WPF: Best suited UI element to display a lot of text?

查看:31
本文介绍了WPF:最适合显示大量文本的 UI 元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个 C#/WPF 程序,我正在其中显示大量文本数据(重播文本日志).这在一个计时器上运行,该计时器从文本文件中读取数据,然后将数据发送到将显示它们的用户控件.我遇到的问题是,在我使用的 TextBlock 中显示覆盖所述第二秒的数据需要一秒钟以上的时间(由于数据量,每秒约 11k 行).如果我跳过显示部分,计时器/程序就会运行得很好,没有任何延迟.

I'm currently working on a C#/WPF program where I'm displaying a lot of text data(replaying a text log). This runs on a timer that reads from text files and then sends the data to a User Control that will display them. The problem I'm having is that it takes more than one second to display the data that covers said second(due to the amount of data, ~11k lines pr second) in the TextBlock I'm using. If I skip the displaying part the timer/program runs just fine without any delays.

就更新速度而言,显示如此大量数据的最佳 UI 元素是什么?

What is the best UI element to display this amount of data with in regards to update speed?

推荐答案

对于大数据,如果您对结果进行分页,几乎总是会更好.

With large data, you are almost always better off if you paginate the results.

这是谷歌对其搜索结果采取的方法.您获得了数百万美元,但只有一小部分出现在第一页上.

This is the approach google takes with their search results. You get millions but only a fraction are on the first page.

Microsoft 为您提供了实现此目的的工具 - FlowDocument

Microsoft gives you the tools to accomplish this - FlowDocument

您可以非常快速地获得具有专业外观的阅读器风格输出,例如 Kindle 屏幕.

You can very quickly get professional looking reader style output, like a Kindle screen.

这篇关于WPF:最适合显示大量文本的 UI 元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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