1


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

InitializeComponent();
加载变得很快。
我想在代码中添加 XAML 内容,但问题是我必须通过代码中的名称访问输入字段,所以它没有用。
知道如何加快页面导航速度。
谢谢..

4

3 回答 3

3

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.

于 2011-05-25T17:16:29.147 回答
1

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

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

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

于 2011-05-25T06:44:05.790 回答
1

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

如果您不小心,在 PanoItems 上输入项目/字段可能会导致 UX 问题。

这么多 panoItems 也可能给用户带来潜在的导航问题。

于 2011-05-26T01:42:02.573 回答