提高页面加载速度

发布于 2024-11-09 10:30:45 字数 421 浏览 0 评论 0原文


在我的应用程序中,我有一个全景页面,其中包含大约 10 个全景项目。每个全景项目都有一些路径图、一个列表选择器和几个输入字段。
我面临的问题是,每当我导航到此页面时,由于需要初始化大量内容,导航速度非常慢。如果我评论

InitializeComponent();
the loading becomes fast.
I thought of adding the XAML content in code, but the problem is that i've to access the input fields by their name in code, so it didn't worked.
Any idea how i can speed up the navigation to the page.
Thanks..

In my app, I've a panorama-page which contains around 10 panorama items. Each panorama item has some path drawings, a list picker and few input fields.
The problem i'm facing is that whenver i navigate to this page the navigation is very slow due to lot of content to initialize. If i comment the

InitializeComponent();

the loading becomes fast.
I thought of adding the XAML content in code, but the problem is that i've to access the input fields by their name in code, so it didn't worked.
Any idea how i can speed up the navigation to the page.
Thanks..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

千鲤 2024-11-16 10:30:45

来自UI 指南

使用单色背景
或跨越整个区域的图像
全景。如果您决定使用
图像,任何 UI 图像类型
Silverlight 支持的是
可以接受,但建议使用 JPEG,
因为它们通常有较小的文件
尺寸优于其他格式。

您可以使用多个图像作为
背景,但你应该注意的是
仅应显示一张图像
任何给定时间。

背景图像应介于
480 x 800 像素和 1024 x 800 像素
(宽x高)保证良好
性能、最短加载时间且无需缩放。

考虑隐藏全景部分
直到有内容可显示。

此外,10 个 PanoramaItems 似乎很多,因为建议的最大数量是 4。您应该减少数量,或者隐藏内容直到需要为止。请阅读 上的全景图最佳实践指南MSDN

From the UI Guide:

Use either a single color background
or an image that spans the entire
panorama. If you decide to use an
image, any UI image type that is
supported by Silverlight is
acceptable, but JPEGs are recommended,
as they generally have smaller file
sizes than other formats.

You can use multiple images as a
background, but you should note that
only one image should be displayed at
any given time.

Background images should be between
480 x 800 pixels and 1024 x 800 pixels
(width x height) to ensure good
performance, minimal load time, and no scaling.

Consider hiding panorama sections
until they have content to display.

Also, 10 PanoramaItems seems like a lot since the recommended maximum is 4. You should either cut down on the number, or hide the content until it's required. Have a read of the best practice guide for Panoramas on MSDN.

谁的年少不轻狂 2024-11-16 10:30:45

我认为您可以通过为特定全景项目创建用户控件来提高页面性能,向页面添加一个空的全景控件(仅包含标题),并按照 picypg 建议在需要时加载这些用户控件。

另一种方法可能是加载第一页并向用户显示该页面。在后台,您可以开始加载其他全景项目。

我建议的方法是第一种。使用延迟加载原理。

I think you could improve page performance by creating usercontrols for the specific panorama items, add an empty panorama control to your page (with only the headers) and as picypg suggests load these usercontrols when they are needed.

Another way could be that you load the first page and show this one already to the user. In the background you could start loading the other panorama items.

My suggested approach would be for the first one. Using the lazyloading principle.

七禾 2024-11-16 10:30:45

我假设您的延迟是由于页面上的项目数量所致。这将导致一个非常大的对象图,并且需要很长时间才能创建。我还预计它会使用大量内存,并且填充率非常高,这会减慢 GPU 的速度。

如果您不小心,在 PanoItems 上添加输入项/字段可能会导致用户体验问题。

许多 panoItem 也可能会给用户带来潜在的导航问题。

I woudl assume that your delays are due to the number of items on the page. This will lead to a very large object graph which will take a long time to create. I'd also expect it's using lots of memory and you have a very high fill rate which is slowing down the GPU.

Having input items/fields on PanoItems can cause UX issues if you're not careful.

That many panoItems could also cause potential navigation issues for the user.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文